repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

dotfiles: new host toolbox inside fedora

d252b8b015e769484d253da0c31aeb15a96c3666

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (26)

cargo/config.toml

Modified
1 1 [build]
2 2 # enable a cache for crates between builds
3 -rustc-wrapper = "sccache"
3 + rustc-wrapper = "sccache"
4 4 # since we only care for builds for our own machine, let's benefit from thise juicy modern cpu features
5 5 rustflags = ["-C", "target-cpu=native"]
13 13 # use the fastest known linker out there (2022)
14 14 [target.x86_64-unknown-linux-gnu]
15 15 # not sure why that is necessary, but without it, rustc seems to pass wrong arguments to mold.
16 -#linker = "clang"
17 -#rustflags = ["-C", "link-arg=--ld-path=/usr/bin/mold"]
16 +linker = "clang"
17 +rustflags = ["-C", "link-arg=--ld-path=/usr/bin/mold"]

neovim/after/queries/lua/highlights.scm

Deleted
deleted file mode 100644
1 -(("local" @keyword) (#set! conceal "⋅"))
2 -(("function" @keyword.function) (#set! conceal "ϝ"))
3 -(("end" @keyword.function) (#set! conceal "∎"))
4 -(("return" @keyword.return) (#set! conceal "↳"))
5 -(("then" @conditional) (#set! conceal "⟶"))
7 -((dot_index_expression table: (identifier) @variable (#eq? @variable "vim")) (#set! conceal ""))
9 -((function_call name: (identifier) @function (#eq? @function "require")) (#set! conceal ""))
11 -; ((function_call name: (identifier) @function (#eq? @function "want")) (#set! conceal "ω"))
12 -; ((local_declaration name: (identifier) @variable (#eq? @variable "want") (#set! conceal "ω"))

neovim/ftplugin/java.lua

Deleted
deleted file mode 100644
1 -local want = require 'std.want'
2 -want {
3 - 'jdtls',
4 - 'lsp-zero',
5 - 'nvim-lsp-installer',
6 -}(function(jdtls, zero, installer)
7 - local debug_log = true
8 - local syntax_server = false
9 - local project = require 'std.project'
10 - local home = os.getenv 'HOME'
12 - local jdtls_root_dir = project.determine_java_project_root '~'
13 - if jdtls_root_dir then
14 - vim.notify('eclipse.jdt.ls java project root is ' .. jdtls_root_dir)
15 - -- even when a project root as found, it does not necessarily mean it is a
16 - -- `classic` java project, in the sense that eclipse.jdt.ls thinks of a "project"
17 - if not project.is_java_project_root(jdtls_root_dir, home) then
18 - -- support for single file mode
19 - syntax_server = true
20 - end
21 - else
22 - vim.notify('no root directory for eclipse.jdt.ls could be found.', 'warning')
23 - -- support for single file mode
24 - syntax_server = true
25 - end
27 - if syntax_server then
28 - vim.notify 'starting eclipse.jdt.ls in syntaxserver mode'
29 - end
31 - local installed, jdtls_installer = installer.get_server 'jdtls'
32 - if not installed then
33 - vim.notify('jdtls is not installed!', error)
34 - return
35 - end
36 - local jdtls_install_dir = jdtls_installer.root_dir
37 - local jdtls_config_dir = nil
38 - local jdtls_syntax_server_config_dir = nil
39 - if vim.fn.has 'mac' == 1 then
40 - jdtls_config_dir = jdtls_install_dir .. '/config_mac'
41 - jdtls_syntax_server_config_dir = jdtls_install_dir .. '/config_ss_mac'
42 - elseif vim.fn.has 'unix' == 1 then
43 - jdtls_config_dir = jdtls_install_dir .. '/config_linux'
44 - jdtls_syntax_server_config_dir = jdtls_install_dir .. '/config_ss_linux'
45 - elseif vim.fn.has 'win32' == 1 then
46 - jdtls_config_dir = jdtls_install_dir .. '/config_win'
47 - jdtls_syntax_server_config_dir = jdtls_install_dir .. '/config_ss_win'
48 - else
49 - vim.notify('eclipse.jdt.ls cannot be configured for current system.', 'error')
50 - return
51 - end
53 - local project_directory
54 - if jdtls_root_dir ~= nil then
55 - project_directory = jdtls_root_dir
56 - else
57 - project_directory = vim.fn.getcwd()
58 - end
59 - local project_name = vim.fn.fnamemodify(project_directory, ':p:h:t')
60 - local nvim_data = vim.fn.stdpath 'data'
61 - local jdtls_workspace_dir = nvim_data .. '/eclipse.jdt.ls.workspace/' .. project_name
62 - vim.fn.mkdir(jdtls_workspace_dir, 'p')
64 - local shared_configuration
65 - if syntax_server then
66 - shared_configuration = jdtls_syntax_server_config_dir
67 - else
68 - shared_configuration = jdtls_config_dir
69 - end
70 - -- sometimes the jdtls cannot start (code 13).
71 - -- it seems to have to do with invalif configuration "config_linux" and/or "~/.config/jdtls"
72 - local jdtls_command = {
73 - 'java',
74 - '-Dsyntaxserver=' .. tostring(syntax_server),
75 - '-Declipse.application=org.eclipse.jdt.ls.core.id1',
76 - '-Dosgi.bundles.defaultStartLevel=4',
77 - '-Declipse.product=org.eclipse.jdt.ls.core.product',
78 - '-Dlog.protocol=' .. tostring(debug_log),
79 - '-Dlog.level=INFO',
80 - '-XX:+UnlockExperimentalVMOptions',
81 - '-XX:+UseZGC',
82 - -- '-XX:+UseParallelGC',
83 - -- '-XX:GCTimeRatio=4',
84 - -- '-XX:AdaptiveSizePolicyWeight=90',
85 - '-Dsun.zip.disableMemoryMapping=true',
86 - '-Djava.import.generatesMetadataFilesAtProjectRoot=false',
87 - '-Xmx4G',
88 - '-Xms100m',
89 - '--add-modules=ALL-SYSTEM',
90 - '--add-opens',
91 - 'java.base/java.util=ALL-UNNAMED',
92 - '--add-opens',
93 - 'java.base/java.lang=ALL-UNNAMED',
94 - '-jar',
95 - vim.fn.glob(jdtls_install_dir .. '/plugins/org.eclipse.equinox.launcher_*.jar', false, false),
96 - '-configuration',
97 - shared_configuration,
98 - '-data',
99 - jdtls_workspace_dir,
100 - }
102 - -- FIXME: what's this? necessary?
103 - local extendedClientCapabilities = jdtls.extendedClientCapabilities
104 - extendedClientCapabilities.resolveAdditionalTextEditsSupport = true
106 - local server_trace = 'off'
107 - if debug_log then
108 - server_trace = 'verbose'
109 - end
111 - -- See `:help vim.lsp.start_client` for an overview of the supported `config` options.
112 - local config = {
113 - -- The command that starts the language server
114 - -- See: https://github.com/eclipse/eclipse.jdt.ls#running-from-the-command-line
115 - cmd = jdtls_command,
117 - -- This is the default if not provided, you can remove it. Or adjust as needed.
118 - -- One dedicated LSP server & client will be started per unique root_dir
119 - root_dir = jdtls_root_dir,
121 - -- Here you can configure eclipse.jdt.ls specific settings
122 - -- See https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request
123 - -- for a list of options
124 - settings = {
125 - java = {
126 - autobuild = true,
127 - sources = {
128 - organizeImports = {
129 - starThreshold = 9999,
130 - staticStarThreshold = 9999,
131 - },
132 - },
133 - codeGeneration = {
134 - generateComments = true,
135 - hashCodeEquals = { useJava7Objects = true, useInstanceOf = true },
136 - -- insertionLocation = '',
137 - toString = {
138 - listArrayContents = true,
139 - skipNullValues = false,
140 - },
141 - useBlocks = true,
142 - },
143 - completion = {
144 - enabled = true,
145 - favoriteStaticMembers = {
146 - 'org.hamcrest.MatcherAssert.assertThat',
147 - 'org.hamcrest.Matchers.*',
148 - 'org.hamcrest.CoreMatchers.*',
149 - 'org.junit.jupiter.api.Assertions.*',
150 - 'java.util.Objects.requireNonNull',
151 - 'java.util.Objects.requireNonNullElse',
152 - 'org.mockito.Mockito.*',
153 - },
154 - filteredTypes = {
155 - 'com.sun.*',
156 - 'java.awt.*',
157 - 'sun.*',
158 - },
159 - guessMethodArguments = false,
160 - importOrder = {
161 - 'java',
162 - 'javax',
163 - 'javafx',
164 - 'com',
165 - 'org',
166 - 'de',
167 - 'net',
168 - },
169 - overwrite = false,
170 - },
171 - configuration = {
173 - --FIXME: configure platforms per host
174 - runtimes = {
175 - {
176 - name = 'JavaSE-1.8',
177 - path = '/usr/lib/jvm/java-8-openjdk-amd64',
178 - },
179 - {
180 - name = 'JavaSE-11',
181 - path = '/usr/lib/jvm/java-11-openjdk-amd64',
182 - },
183 - {
184 - name = 'JavaSE-17',
185 - path = '/usr/lib/jvm/java-17-openjdk-amd64',
186 - default = true,
187 - },
188 - },
189 - updateBuildConfiguration = 'automatic',
190 - },
191 - eclipse = { downloadSources = true },
192 - errors = { incompleteClasspath = { severity = 'warning' } },
193 - foldingRange = false,
194 - format = {
195 - enabled = true,
196 - onType = false,
197 - },
198 - implementationsCodeLens = true,
199 - inlayhints = { parameterNames = true },
200 - maven = { downloadSources = true, updateSnapshots = false },
201 - maxConcurrentBuilds = 8,
202 - referenceCodeLens = true,
203 - rename = true,
204 - saveActions = { organizeImports = true },
205 - selectionRange = true,
206 - signatureHelp = true,
207 - trace = { server = server_trace },
208 - },
209 - },
211 - -- Language server `initializationOptions`
212 - -- You need to extend the `bundles` with paths to jar files
213 - -- if you want to use additional eclipse.jdt.ls plugins.
214 - --
215 - -- See https://github.com/mfussenegger/nvim-jdtls#java-debug-installation
216 - --
217 - -- If you don't plan on using the debugger or other eclipse.jdt.ls plugins you can remove this
218 - init_options = {
219 - -- TODO: integrate debug and test extensions. can those be installed via paq, even though they are not vim plugins?
220 - bundles = {},
221 - extendedClientCapabilities = extendedClientCapabilities,
222 - },
223 - flags = {
224 - debounce_text_changes = 80,
225 - allow_incremental_sync = true,
226 - },
227 - }
228 - -- This starts a new client & server,
229 - -- or attaches to an existing client & server depending on the `root_dir`.
230 - local merged_config = zero.build_options('jdtls', config)
231 - jdtls.start_or_attach(merged_config)
232 -end)

neovim/ftplugin/java.lua.bak

Added
new file mode 100644
1 +local want = require 'std.want'
2 +want {
3 + 'jdtls',
4 + 'lsp-zero',
5 + 'nvim-lsp-installer',
6 +}(function(jdtls, zero, installer)
7 + local debug_log = true
8 + local syntax_server = false
9 + local project = require 'std.project'
10 + local home = os.getenv 'HOME'
12 + local jdtls_root_dir = project.determine_java_project_root '~'
13 + if jdtls_root_dir then
14 + vim.notify('eclipse.jdt.ls java project root is ' .. jdtls_root_dir)
15 + -- even when a project root as found, it does not necessarily mean it is a
16 + -- `classic` java project, in the sense that eclipse.jdt.ls thinks of a "project"
17 + if not project.is_java_project_root(jdtls_root_dir, home) then
18 + -- support for single file mode
19 + syntax_server = true
20 + end
21 + else
22 + vim.notify('no root directory for eclipse.jdt.ls could be found.', 'warning')
23 + -- support for single file mode
24 + syntax_server = true
25 + end
27 + if syntax_server then
28 + vim.notify 'starting eclipse.jdt.ls in syntaxserver mode'
29 + end
31 + local installed, jdtls_installer = installer.get_server 'jdtls'
32 + if not installed then
33 + vim.notify('jdtls is not installed!', error)
34 + return
35 + end
36 + local jdtls_install_dir = jdtls_installer.root_dir
37 + local jdtls_config_dir = nil
38 + local jdtls_syntax_server_config_dir = nil
39 + if vim.fn.has 'mac' == 1 then
40 + jdtls_config_dir = jdtls_install_dir .. '/config_mac'
41 + jdtls_syntax_server_config_dir = jdtls_install_dir .. '/config_ss_mac'
42 + elseif vim.fn.has 'unix' == 1 then
43 + jdtls_config_dir = jdtls_install_dir .. '/config_linux'
44 + jdtls_syntax_server_config_dir = jdtls_install_dir .. '/config_ss_linux'
45 + elseif vim.fn.has 'win32' == 1 then
46 + jdtls_config_dir = jdtls_install_dir .. '/config_win'
47 + jdtls_syntax_server_config_dir = jdtls_install_dir .. '/config_ss_win'
48 + else
49 + vim.notify('eclipse.jdt.ls cannot be configured for current system.', 'error')
50 + return
51 + end
53 + local project_directory
54 + if jdtls_root_dir ~= nil then
55 + project_directory = jdtls_root_dir
56 + else
57 + project_directory = vim.fn.getcwd()
58 + end
59 + local project_name = vim.fn.fnamemodify(project_directory, ':p:h:t')
60 + local nvim_data = vim.fn.stdpath 'data'
61 + local jdtls_workspace_dir = nvim_data .. '/eclipse.jdt.ls.workspace/' .. project_name
62 + vim.fn.mkdir(jdtls_workspace_dir, 'p')
64 + local shared_configuration
65 + if syntax_server then
66 + shared_configuration = jdtls_syntax_server_config_dir
67 + else
68 + shared_configuration = jdtls_config_dir
69 + end
70 + -- sometimes the jdtls cannot start (code 13).
71 + -- it seems to have to do with invalif configuration "config_linux" and/or "~/.config/jdtls"
72 + local jdtls_command = {
73 + 'java',
74 + '-Dsyntaxserver=' .. tostring(syntax_server),
75 + '-Declipse.application=org.eclipse.jdt.ls.core.id1',
76 + '-Dosgi.bundles.defaultStartLevel=4',
77 + '-Declipse.product=org.eclipse.jdt.ls.core.product',
78 + '-Dlog.protocol=' .. tostring(debug_log),
79 + '-Dlog.level=INFO',
80 + '-XX:+UnlockExperimentalVMOptions',
81 + '-XX:+UseZGC',
82 + -- '-XX:+UseParallelGC',
83 + -- '-XX:GCTimeRatio=4',
84 + -- '-XX:AdaptiveSizePolicyWeight=90',
85 + '-Dsun.zip.disableMemoryMapping=true',
86 + '-Djava.import.generatesMetadataFilesAtProjectRoot=false',
87 + '-Xmx4G',
88 + '-Xms100m',
89 + '--add-modules=ALL-SYSTEM',
90 + '--add-opens',
91 + 'java.base/java.util=ALL-UNNAMED',
92 + '--add-opens',
93 + 'java.base/java.lang=ALL-UNNAMED',
94 + '-jar',
95 + vim.fn.glob(jdtls_install_dir .. '/plugins/org.eclipse.equinox.launcher_*.jar', false, false),
96 + '-configuration',
97 + shared_configuration,
98 + '-data',
99 + jdtls_workspace_dir,
102 + -- FIXME: what's this? necessary?
103 + local extendedClientCapabilities = jdtls.extendedClientCapabilities
104 + extendedClientCapabilities.resolveAdditionalTextEditsSupport = true
106 + local server_trace = 'off'
107 + if debug_log then
108 + server_trace = 'verbose'
109 + end
111 + -- See `:help vim.lsp.start_client` for an overview of the supported `config` options.
112 + local config = {
113 + -- The command that starts the language server
114 + -- See: https://github.com/eclipse/eclipse.jdt.ls#running-from-the-command-line
115 + cmd = jdtls_command,
117 + -- This is the default if not provided, you can remove it. Or adjust as needed.
118 + -- One dedicated LSP server & client will be started per unique root_dir
119 + root_dir = jdtls_root_dir,
121 + -- Here you can configure eclipse.jdt.ls specific settings
122 + -- See https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request
123 + -- for a list of options
124 + settings = {
125 + java = {
126 + autobuild = true,
127 + sources = {
128 + organizeImports = {
129 + starThreshold = 9999,
130 + staticStarThreshold = 9999,
131 + },
132 + },
133 + codeGeneration = {
134 + generateComments = true,
135 + hashCodeEquals = { useJava7Objects = true, useInstanceOf = true },
136 + -- insertionLocation = '',
137 + toString = {
138 + listArrayContents = true,
139 + skipNullValues = false,
140 + },
141 + useBlocks = true,
142 + },
143 + completion = {
144 + enabled = true,
145 + favoriteStaticMembers = {
146 + 'org.hamcrest.MatcherAssert.assertThat',
147 + 'org.hamcrest.Matchers.*',
148 + 'org.hamcrest.CoreMatchers.*',
149 + 'org.junit.jupiter.api.Assertions.*',
150 + 'java.util.Objects.requireNonNull',
151 + 'java.util.Objects.requireNonNullElse',
152 + 'org.mockito.Mockito.*',
153 + },
154 + filteredTypes = {
155 + 'com.sun.*',
156 + 'java.awt.*',
157 + 'sun.*',
158 + },
159 + guessMethodArguments = false,
160 + importOrder = {
161 + 'java',
162 + 'javax',
163 + 'javafx',
164 + 'com',
165 + 'org',
166 + 'de',
167 + 'net',
168 + },
169 + overwrite = false,
170 + },
171 + configuration = {
173 + --FIXME: configure platforms per host
174 + runtimes = {
176 + name = 'JavaSE-1.8',
177 + path = '/usr/lib/jvm/java-8-openjdk-amd64',
178 + },
180 + name = 'JavaSE-11',
181 + path = '/usr/lib/jvm/java-11-openjdk-amd64',
182 + },
184 + name = 'JavaSE-17',
185 + path = '/usr/lib/jvm/java-17-openjdk-amd64',
186 + default = true,
187 + },
188 + },
189 + updateBuildConfiguration = 'automatic',
190 + },
191 + eclipse = { downloadSources = true },
192 + errors = { incompleteClasspath = { severity = 'warning' } },
193 + foldingRange = false,
194 + format = {
195 + enabled = true,
196 + onType = false,
197 + },
198 + implementationsCodeLens = true,
199 + inlayhints = { parameterNames = true },
200 + maven = { downloadSources = true, updateSnapshots = false },
201 + maxConcurrentBuilds = 8,
202 + referenceCodeLens = true,
203 + rename = true,
204 + saveActions = { organizeImports = true },
205 + selectionRange = true,
206 + signatureHelp = true,
207 + trace = { server = server_trace },
208 + },
209 + },
211 + -- Language server `initializationOptions`
212 + -- You need to extend the `bundles` with paths to jar files
213 + -- if you want to use additional eclipse.jdt.ls plugins.
214 + --
215 + -- See https://github.com/mfussenegger/nvim-jdtls#java-debug-installation
216 + --
217 + -- If you don't plan on using the debugger or other eclipse.jdt.ls plugins you can remove this
218 + init_options = {
219 + -- TODO: integrate debug and test extensions. can those be installed via paq, even though they are not vim plugins?
220 + bundles = {},
221 + extendedClientCapabilities = extendedClientCapabilities,
222 + },
223 + flags = {
224 + debounce_text_changes = 80,
225 + allow_incremental_sync = true,
226 + },
228 + -- This starts a new client & server,
229 + -- or attaches to an existing client & server depending on the `root_dir`.
230 + local merged_config = zero.build_options('jdtls', config)
231 + jdtls.start_or_attach(merged_config)
232 +end)

neovim/ftplugin/lua.lua

Modified
1 --- conceal some syntax with pretty symbols and show them only in
2 --- insert mode. see after/queries/lua/highlights.scm for more.
3 -vim.opt_local.conceallevel = 2
4 -vim.opt_local.concealcursor = 'nc'
6 1 -- Options to add `gf` functionality inside `.lua` files.
7 2 vim.opt_local.include = [[\v<((do|load)file|require)[^''"]*[''"]\zs[^''"]+]]
8 3 vim.opt_local.includeexpr = "substitute(v:fname,'\\.','/','g')"

neovim/ftplugin/markdown.lua

Modified
1 1 -- auto save markdown files
2 2 vim.opt_local.autowriteall = true
3 --- hide code block fences

neovim/init.lua

Modified
7 7 -- ███ █▄ ▄█ ███ █ ███ ▐ █ █ █ ███ █
8 8 -- ▀▀▀ █ █ ██ █
9 9 -- ▀ ▀
11 -local want = require'std.want'
13 -want {
14 - -- set general neovim editor settings
15 - 'bugabinga.options',
16 - -- install plugin manager and declare plugins to use
17 - 'bugabinga.lazy',
18 - -- configures the vim diagnostic subsystem
19 - 'bugabinga.diagnostic',
20 - 'bugabinga.trim',
21 -}()
23 --- load ui stuff
24 --- require 'bugabinga.windows'
26 --- treesitter
27 --- require 'buabinga.treesitter'
10 +-- set general neovim editor settings
11 +require'bugabinga.options'
12 +-- install plugin manager and declare plugins to use
13 +require'bugabinga.lazy'
14 +-- configures the vim diagnostic subsystem
15 +require'bugabinga.diagnostic'
16 +-- FIXME(buga): should this be moved somewhere else?
17 +require'bugabinga.trim'
29 18 -- lsp
30 19 -- require 'bugabinga.lsp'

neovim/lazy-lock.json

Modified
2 2 "Comment.nvim": { "branch": "master", "commit": "e51f2b142d88bb666dcaa77d93a07f4b419aca70" },
3 + "better-escape.nvim": { "branch": "master", "commit": "7031dc734add47bb71c010e0551829fa5799375f" },
3 4 "cmp-omni": { "branch": "main", "commit": "9436e6cdd7c5dfa24a99a60d9280b24dbdea3649" },
4 5 "dressing.nvim": { "branch": "master", "commit": "e6eff7a5a950a853c3903d906dbcea03f778db5f" },
5 - "gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" },
6 + "gitsigns.nvim": { "branch": "main", "commit": "5a04466685008f29c71fa5ec25d421deb1c83fea" },
6 7 "glow.nvim": { "branch": "main", "commit": "cf2177a514859fa3c55837b46de91d93b24cf488" },
7 8 "heirline.nvim": { "branch": "master", "commit": "76136ccd93ed608e8109762f032cf1118981ebbd" },
8 9 "hlargs.nvim": { "branch": "main", "commit": "cfc9beab4e176a13311efe03e38e6b6fed5df4f6" },
9 - "indent-blankline.nvim": { "branch": "master", "commit": "73640233cca0da8e01aced8c1f9e63fd892128b7" },
10 - "lazy.nvim": { "branch": "main", "commit": "da8b00581a52f5f87ad2aba9f52171fda7491f18" },
10 + "indent-blankline.nvim": { "branch": "master", "commit": "b7aa0aed55887edfaece23f7b46ab22232fc8741" },
11 + "indent-o-matic": { "branch": "master", "commit": "4d11e98f523d3c4500b1dc33f0d1a248a4f69719" },
12 + "lazy.nvim": { "branch": "main", "commit": "14d76aac4bd3ff07c1fca074c210f28f766a931e" },
11 13 "lush.nvim": { "branch": "main", "commit": "b10ef2bfff0647e701b691019ade3edd5e44eb50" },
12 - "noice.nvim": { "branch": "main", "commit": "6517b4f238a1e8e62cddf1c0ce332d3e03969aba" },
14 + "neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" },
15 + "noice.nvim": { "branch": "main", "commit": "6c87c1d11c38180fb72bf8f45518a0a3e081afc1" },
13 16 "nrpattern.nvim": { "branch": "master", "commit": "f862ce687761078ef3155688151c55f69d28453e" },
14 17 "nui.nvim": { "branch": "main", "commit": "7a524120a7a70761b5a65b602fd235a65cb005aa" },
18 + "nvim-autopairs": { "branch": "master", "commit": "ae5b41ce880a6d850055e262d6dfebd362bb276e" },
15 19 "nvim-cmp": { "branch": "main", "commit": "983453e32cb35533a119725883c04436d16c0120" },
16 20 "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" },
17 21 "nvim-genghis": { "branch": "main", "commit": "6278a9e05f2daac5578ac043d9372f71a4ddf07c" },
20 24 "nvim-neoclip.lua": { "branch": "main", "commit": "4e406ae0f759262518731538f2585abb9d269bac" },
21 25 "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" },
22 26 "nvim-surround": { "branch": "main", "commit": "211eaad7c6d01ef4ac02cba9052b3082ec232101" },
27 + "nvim-treesitter": { "branch": "master", "commit": "39f10b0b14184f746a0c9e7475c5ea81a9a812f6" },
28 + "nvim-treesitter-textobjects": { "branch": "master", "commit": "52f1f3280d9092bfaee5c45be5962fabee3d9654" },
29 + "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" },
30 + "nvim-ts-context-commentstring": { "branch": "main", "commit": "7f625207f225eea97ef7a6abe7611e556c396d2f" },
23 31 "nvim-web-devicons": { "branch": "master", "commit": "9ab9b0b894b2388a9dbcdee5f00ce72e25d85bf9" },
24 32 "oil.nvim": { "branch": "master", "commit": "0138a2e0f9baacd98d5531ebb5078fafc5114fae" },
33 + "playground": { "branch": "master", "commit": "2b81a018a49f8e476341dfcb228b7b808baba68b" },
25 34 "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
26 35 "specs.nvim": { "branch": "main", "commit": "2743e412bbe21c9d73954c403d01e8de7377890d" },
27 36 "substitute.nvim": { "branch": "main", "commit": "42d09f1e6324d98aa2e5b765b64528e0aefe72b0" },
29 38 "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
30 39 "telescope-symbols.nvim": { "branch": "master", "commit": "f2060117d965df4a626f068a4ebbd8ee051aa076" },
31 40 "telescope.nvim": { "branch": "0.1.x", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" },
41 + "toggleterm.nvim": { "branch": "main", "commit": "b90a1381e9b5b8596f49070ee86c71db267ac868" },
32 42 "tokyonight.nvim": { "branch": "main", "commit": "a0a7bfbc4c54348b56880a162afac9d103c618c1" },
33 43 "treesj": { "branch": "main", "commit": "3203aa553217921fd4dcb79245f9df07278910b2" },
34 - "virt-column.nvim": { "branch": "master", "commit": "93b40ea038f676f5a72d7d1f2336fe7b051fc0ce" }
44 + "twilight.nvim": { "branch": "main", "commit": "8bb7fa7b918baab1ca81b977102ddb54afa63512" },
45 + "virt-column.nvim": { "branch": "master", "commit": "93b40ea038f676f5a72d7d1f2336fe7b051fc0ce" },
46 + "zen-mode.nvim": { "branch": "main", "commit": "68f554702de63f4b7b6b6d4bcb10178f41a0acc7" }

neovim/lua/bugabinga/diagnostic.lua

Modified
2 2 local want = require 'std.want'
3 3 local auto = require 'std.auto'
4 4 local map = require 'std.keymap'
6 -local icon = { '󰇷 ', '󰱶 ', ' ', '󰨦 ' }
6 +local icon = { ' ', ' ', '', '💡' }
7 7 icon.error = icon[1]
8 8 icon.warn = icon[2]
9 9 icon.info = icon[3]
18 18 local diagnostic = vim.diagnostic
19 +diagnostic.disable(0)
20 21 local diagnostic_format = function(context)
21 22 return string.format('%s: %s', display_name[context.severity], context.message)
54 55 texthl = options.name,
55 56 numhl = options.name,
56 57 culhl = options.name,
57 - -- linehl = options.name,
58 + linehl = options.name,
63 64 sign { name = 'DiagnosticSignHint', text = icon.hint }
64 65 sign { name = 'DiagnosticSignInfo', text = icon.info }
66 -auto 'hide_diagnostics' {
67 - description = 'Hide diagnostics by default',
68 - events = { 'BufReadPre' },
69 - pattern = '*',
70 - command = function()
71 - diagnostic.disable(0)
72 - end,
75 -local noticeable_ns = vim.api.nvim_create_namespace 'noticeable'
76 -local noticeable_hl = { foreground = '#338383', background = '#883333' }
78 -auto 'cursor_attention_if_diagnostics' {
79 - description = 'Make cursor very noticeable, if diagnostics are present',
80 - events = 'DiagnosticChanged',
81 - pattern = '*',
82 - command = function()
83 - local window = vim.api.nvim_get_current_win()
84 - local diagnostic_number = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR })
85 - if diagnostic_number > 0 then
86 - vim.api.nvim_set_hl(noticeable_ns, 'Cursor', noticeable_hl)
87 - vim.api.nvim_win_set_hl_ns(window, noticeable_ns)
88 - else
89 - vim.api.nvim_set_hl(noticeable_ns, 'Cursor', {}) -- reset highlight
90 - vim.api.nvim_win_set_hl_ns(window, 0)
91 - end
92 - end,
95 67 map.normal {
96 68 name = 'Toggle diagnostics',
97 69 category = 'diagnostic',
82 +local show_diagnostics = function()
83 + want'telescope.builtin'(
84 + function(builtin)
85 + builtin.diagnostics()
86 + end,
87 + function()
88 + -- seems to have bug: https://github.com/neovim/neovim/issues/21949
89 + diagnostic.open_float()
90 + end)
91 +end
110 93 map.normal {
111 - name = 'Show diagnostics in float window',
112 - category = 'diagnostic',
113 - keys = '<F6>',
114 - command = function()
115 - diagnostic.enable(0)
116 - diagnostic.open_float()
117 - end,
94 + name = 'Show diagnostics in float window',
95 + category = 'diagnostic',
96 + keys = '<F6>',
97 + command = function()
98 + if #diagnostic.get(0) > 0 then
99 + if diagnostic.is_disabled(0) then
100 + diagnostic.enable(0)
101 + vim.notify 'Enabling Diagnostics'
102 + end
103 + show_diagnostics()
104 + else
105 + vim.notify 'No diagnostics to show!'
106 + end
107 + end,
120 110 map.normal {
121 - name = 'Go to previous diagnostic',
122 - category = 'diagnostic',
123 - keys = '<C-F6>',
124 - command = function()
125 - diagnostic.enable(0)
126 - diagnostic.goto_prev()
127 - end,
111 + name = 'Go to previous diagnostic',
112 + category = 'diagnostic',
113 + keys = '<C-F6>',
114 + command = function()
115 + diagnostic.enable(0)
116 + diagnostic.goto_prev()
117 + end,
130 120 map.normal {
131 - name = 'Go to next diagnostic',
132 - category = 'diagnostic',
133 - keys = '<S-F6>',
134 - command = function()
135 - diagnostic.enable(0)
136 - diagnostic.goto_next()
137 - end,
121 + name = 'Go to next diagnostic',
122 + category = 'diagnostic',
123 + keys = '<S-F6>',
124 + command = function()
125 + diagnostic.enable(0)
126 + diagnostic.goto_next()
127 + end,
140 130 -- a little debug helper to show all kinds of diagnostics

neovim/lua/bugabinga/health.lua

Modified
14 14 local function check_program(name, name_of_executable)
15 15 local display_name = name and (name .. '(' .. name_of_executable .. ')') or name_of_executable
16 - vim.health.start(name .. ' report')
16 + vim.health.start(display_name .. ' report')
17 17 if program_installed(name_of_executable) then
18 18 vim.health.ok(display_name .. ' found on system')
19 19 else
27 27 check_parameter(program, 'add_program', 'program', 'table')
28 28 check_parameter(program.name_of_executable, 'add_program', 'program.name_of_executable', 'string')
30 - if not programs_to_check[program] then
31 - table.insert(programs_to_check, program)
32 - end
33 -
30 + programs_to_check[program.name_of_executable] = program
34 32 -- returns itself so that multiple programs can be chain-added
35 33 return _.add_dependency
38 36 _.check = function()
39 37 vim.iter(programs_to_check)
40 - :each(function(program)
38 + :each(function(_, program)
41 39 check_program(program.name, program.name_of_executable)
42 40 end)

neovim/lua/bugabinga/nugu/init.lua

Modified
41 41 Normal { fg = content_normal, bg = content_backdrop },
42 42 NotifyBackground { bg = ui_backdrop },
43 43 Comment { fg = content_important_global, gui = 'bold italic' },
44 - LineNr { fg = content_unfocus, bg = content_backdrop },
44 + LineNr { fg = ui_minor, bg = ui_backdrop },
45 45 CursorLineNr { fg = ui_focus, bg = ui_backdrop },
46 46 Search { fg = content_important_global.readable(), bg = content_important_global },
47 47 IncSearch { fg = content_important_local.readable(), bg = content_important_local },
65 65 VertSplit { fg = ui_important_global, bg = content_backdrop }, -- the column separating vertically split windows
66 66 Folded { Conceal }, -- line used for closed folds
67 67 FoldColumn { Conceal }, -- 'foldcolumn'
68 - SignColumn { LineNr }, -- column where |signs| are displayed
68 + SignColumn { bg = ui_backdrop }, -- column where |signs| are displayed
69 69 ModeMsg { gui = 'bold' }, -- 'showmode' message (e.g., "-- INSERT -- ")
70 70 MsgArea { Normal }, -- Area for messages and cmdline
71 71 MsgSeparator { fg = ui_accent }, -- Separator for scrolled messages, `msgsep` flag of 'display'
106 106 Boolean { String }, -- a boolean constant: TRUE, false
107 107 Float { String }, -- a floating point constant: 2.3e10
109 - Identifier { Normal, gui = 'bold' }, -- (preferred) any variable name
110 - Function { Normal, gui = 'bold' }, -- function name (also: methods for classes)
109 + Identifier { Normal }, -- (preferred) any variable name
110 + Function { Normal }, -- function name (also: methods for classes)
112 112 Statement { fg = content_minor }, -- (preferred) any statement
113 113 Conditional { Statement }, -- if, then, else, endif, switch, etc.
128 128 Structure { Statement }, -- struct, union, enum, etc.
129 129 Typedef { Statement }, -- A typedef
131 - Special { fg = content_accent, gui = 'italic bold' }, -- (preferred) any special symbol
131 + Special { fg = content_normal, gui = 'italic bold' }, -- (preferred) any special symbol
132 132 SpecialChar { Special }, -- special character in a constant
133 133 Tag { Special }, -- you can use CTRL-] on this
134 - Delimiter { Special }, -- character that needs attention
134 + Delimiter { fg = content_minor }, -- character that needs attention
135 135 SpecialComment { Special }, -- special things inside a comment
137 137 Underlined { sp = content_normal, gui = 'underline' }, -- (preferred) text that stands out, HTML links

neovim/lua/bugabinga/options/togglers.lua

Modified
50 50 table.insert(_, make_toggler(display_name, togglers ))
53 -add_toggler('spell check', { make_option'spell' } )
54 -add_toggler('line numbers', { make_option'number', make_option'relativenumber'})
55 -add_toggler('cursor line', { make_option'cursorline'} )
53 +add_toggler('暈', { make_option'spell' } )
54 +add_toggler(' ', { make_option'number', make_option'relativenumber'})
55 +add_toggler('―', { make_option'cursorline'} )
57 57 local tostring = function(self)
58 58 return vim.iter(self)
59 59 :map(toggler_tostring)
60 60 :fold('', function(buffer, text)
61 - return buffer .. (buffer == '' and '' or ' ⃒ ') .. text
61 + return buffer .. (buffer == '' and '' or ' ') .. text
62 62 end)

neovim/lua/bugabinga/options/ui.lua

Modified
18 18 vim.opt.wrap = true
20 20 -- always display the signcolumn to avoid jitter
21 -vim.opt.signcolumn = 'yes'
21 +-- also, merge it with numbercolumn
22 +vim.opt.signcolumn = 'number'
23 24 -- what is a ruler? me?
24 25 vim.opt.ruler = false

neovim/lua/bugabinga/plugins/autopairs.lua

Added
new file mode 100644
1 +return {
2 + 'windwp/nvim-autopairs',
3 + event = "InsertEnter",
4 + opts = {}
5 +}

neovim/lua/bugabinga/plugins/better-escape.lua

Added
new file mode 100644
1 +return {
2 + "max397574/better-escape.nvim",
3 + event = "InsertEnter",
4 + opts = {},
5 +}

neovim/lua/bugabinga/plugins/comment.lua

Modified
1 1 return {{
2 2 'numToStr/Comment.nvim',
3 - lazy = false,
4 - opts = {},
3 + keys = {
4 + { "gc", mode = { "n", "v" }, desc = "Comment toggle linewise" },
5 + { "gb", mode = { "n", "v" }, desc = "Comment toggle blockwise" },
6 + },
7 + dependencies = {
8 + "JoosepAlviste/nvim-ts-context-commentstring",
9 + },
10 + opts = function()
11 + local commentstring_avail, commentstring = pcall(require, "ts_context_commentstring.integrations.comment_nvim")
12 + return commentstring_avail and commentstring and { pre_hook = commentstring.create_pre_hook() } or {}
13 + end,

neovim/lua/bugabinga/plugins/gitsigns.lua

Modified
1 1 return {
2 2 'lewis6991/gitsigns.nvim',
3 + branch='main',
3 4 event = 'VeryLazy',
4 5 opts = {},

neovim/lua/bugabinga/plugins/heirline.lua

Modified
34 34 niR = "Νr",
35 35 niV = "Νv",
36 36 nt = "Νt",
37 - v = "𝗩",
38 - vs = "𝗩 s",
39 - V = "𝗩 _",
40 - Vs = "𝗩 s",
37 + v = "𝗩 ",
38 + vs = "𝗩 s",
39 + V = "𝗩 _",
40 + Vs = "𝗩 s",
41 41 ["\22"] = "^V",
42 42 ["\22s"] = "^V",
43 43 s = "S",
46 46 i = "Ι",
47 47 ic = "Ιc",
48 48 ix = "Ιx",
49 - R = " ",
50 - Rc = " c",
51 - Rx = " x",
52 - Rv = " v",
53 - Rvc = " v",
54 - Rvx = " v",
55 - c = "C",
56 - cv = "Ex",
57 - r = "...",
49 + R = "𝐑 ",
50 + Rc = "𝐑c",
51 + Rx = "𝐑x",
52 + Rv = "𝐑v",
53 + Rvc = "𝐑v",
54 + Rvx = "𝐑v",
55 + c = "𝐂 ",
56 + cv = "𝐄x",
57 + r = " ",
58 58 rm = "M",
59 59 ["r?"] = "?",
60 60 ["!"] = "!",
61 - t = " ",
61 + t = " ",
63 63 mode_colors = {
64 64 n = "ui_normal" ,
130 130 condition = function()
131 131 return vim.bo.modified
133 - provider = "  ",
133 + provider = "  ",
134 134 hl = 'Comment',
157 157 local file_type = {
158 158 provider = function()
159 - return ' ' .. string.upper(vim.bo.filetype)
159 + return ' ' .. string.upper(vim.bo.filetype)
291 291 command = 'svn',
292 292 args = { 'info', '--show-item', 'relative-url', '--no-newline' },
293 293 on_exit = function(current_job, exit_code)
294 - vim.print(vim.inspect(out), exit_code)
295 294 if exit_code == 0 then relative_url = current_job:result() end
297 296 }:sync()
299 - return relative_url
298 + return relative_url[1]
302 301 local svn = {
330 329 provider = function(self)
331 330 local count = self.status_dict.added or 0
332 - return count > 0 and (" " .. count .. ' ')
331 + return count > 0 and (" " .. count .. ' ')
334 333 hl = 'DiffAdd',
337 336 provider = function(self)
338 337 local count = self.status_dict.removed or 0
339 - return count > 0 and (" " .. count .. ' ')
338 + return count > 0 and (" " .. count .. ' ')
341 340 hl = 'DiffDelete',
344 343 provider = function(self)
345 344 local count = self.status_dict.changed or 0
346 - return count > 0 and (" " .. count .. ' ')
345 + return count > 0 and (" " .. count .. ' ')
348 347 hl = 'DiffChange',
404 403 local togglers = {
406 - provider = function(self) end,
404 + provider = function(self)
405 + local togglers = require'bugabinga.options.togglers'
406 + return tostring(togglers)
407 + end,
409 410 local macro_recording = {
507 508 file_type, space, terminal_name,
510 - -- TODO: replace with navic. file name is already in statusline
511 511 file_name_block,
536 536 local tabline = { tab_pages }
538 - local statuscolumn = {}
538 + -- local statuscolumn = {}
540 540 heirline.setup {
541 541 statusline = statuslines,
542 542 winbar = winbars,
543 543 tabline = tabline,
544 - statuscolumn = statuscolumn,
544 + -- statuscolumn = statuscolumn,
546 546 opts = {
547 547 colors = nugu,

neovim/lua/bugabinga/plugins/indent-o-matic.lua

Added
new file mode 100644
1 +return {
2 + 'Darazaki/indent-o-matic',
3 + event = 'BufReadPost',
4 + opts = {},
5 +}

neovim/lua/bugabinga/plugins/neogen.lua

Added
new file mode 100644
1 +return {
2 + 'danymat/neogen',
3 + keys = {'<A-enter>'},
4 + dependencies = {'nvim-treesitter/nvim-treesitter'},
5 + config = function()
6 + local neogen = require'neogen'
8 + neogen.setup { }
10 + map.normal {
11 + name = 'Generate doc comment for outer element',
12 + category = 'editing',
13 + keys = '<A-enter>',
14 + command = neogen.generate,
15 + }
17 + map.normal {
18 + name = 'Generate Doc Comment for Function',
19 + category = "editing",
20 + keys = '<A-enter>' .. 'f',
21 + command = function() neogen.generate { type = 'func' } end,
22 + }
24 + map.normal {
25 + name = 'Generate Doc Comment for File',
26 + category = "editing",
27 + keys = '<A-enter>' .. 'F',
28 + command = function() neogen.generate { type = 'file' } end,
29 + }
31 + map.normal {
32 + name = 'Generate Doc Comment for Class',
33 + category = "editing",
34 + keys = '<A-enter>' .. 'c',
35 + command = function() neogen.generate { type = 'class' } end,
36 + }
38 + end,

neovim/lua/bugabinga/plugins/noice.lua

Modified
2 2 return {
4 4 'folke/noice.nvim',
5 5 event = 'VeryLazy',
6 + branch = 'main',
6 7 opts = {
7 8 cmdline = {
8 9 view = 'cmdline', -- cmdline on bottom
26 27 popupmenu = { border = { style = "shadow" } },
27 28 popup = { border = { style = "shadow" } },
28 29 hover = { border = { style = "shadow" } },
29 - cmdline = { relative = "cursor", position = { row = 0, col = 0 }, border = { style = "shadow" } },
30 + -- does not seem to play well with other popups
31 + -- cmdline = { relative = "cursor", position = { row = 0, col = 0 }, border = { style = "shadow" } },
32 34 dependencies = {

neovim/lua/bugabinga/plugins/toggleterm.lua

Added
new file mode 100644
1 +return {
2 + "akinsho/toggleterm.nvim",
3 + keys = '<F7>',
4 + cmd = { "ToggleTerm", "TermExec" },
5 + opts = {
6 + size = 10,
7 + on_create = function()
8 + vim.opt.foldcolumn = "0"
9 + vim.opt.signcolumn = "no"
10 + end,
11 + open_mapping = [[<F7>]],
12 + shading_factor = 2,
13 + direction = "float",
14 + float_opts = {
15 + border = "shadow",
16 + highlights = { border = "Normal", background = "Normal" },
17 + },
18 + },

neovim/lua/bugabinga/plugins/treesitter.lua

Added
new file mode 100644
1 +local map = require 'std.keymap'
2 +local auto = require 'std.auto'
3 +local want = require 'std.want'
5 +require'bugabinga.health'.add_dependency
6 +{
7 + name = 'CMake',
8 + name_of_executable = 'cmake'
9 +}
11 + name_of_executable = 'make'
14 + name_of_executable = 'zig'
17 + name = 'TreeSitter CLI',
18 + name_of_executable = 'tree-sitter'
21 +return {
22 + 'nvim-treesitter/nvim-treesitter',
23 + branch = "master",
24 + event = {"BufReadPost", "BufNewFile"},
25 + cmd = {
26 + "TSBufDisable",
27 + "TSBufEnable",
28 + "TSBufToggle",
29 + "TSDisable",
30 + "TSEnable",
31 + "TSToggle",
32 + "TSInstall",
33 + "TSInstallInfo",
34 + "TSInstallSync",
35 + "TSModuleInfo",
36 + "TSUninstall",
37 + "TSUpdate",
38 + "TSUpdateSync",
39 + 'TSPlaygroundToggle',
40 + 'TSHighlightCapturesUnderCursor',
41 + 'TSNodeUnderCursor',
42 + },
43 + build = function()
44 + require'nvim-treesitter.install'.update{ with_sync = true }
45 + end,
46 + dependencies = {
47 + "JoosepAlviste/nvim-ts-context-commentstring",
48 + "nvim-treesitter/nvim-treesitter-textobjects",
49 + "windwp/nvim-ts-autotag",
50 + 'nvim-treesitter/playground',
51 + },
52 + config = function()
53 + local install = require'nvim-treesitter.install'
54 + local configs = require'nvim-treesitter.configs'
55 + local parsers = require'nvim-treesitter.parsers'
57 + install.compilers = { 'zig', 'clang', 'gcc', 'cl', 'cc', vim.fn.getenv 'CC' }
59 + configs.setup {
60 + ensure_installed = {
61 + 'bash',
62 + "c",
63 + 'comment',
64 + 'diff',
65 + 'dot',
66 + 'git_config',
67 + 'gitcommit',
68 + 'gitignore',
69 + 'java',
70 + 'jsonc',
71 + 'markdown',
72 + 'markdown_inline',
73 + "lua",
74 + 'luap',
75 + 'luadoc',
76 + 'regex',
77 + "vim",
78 + "vimdoc",
79 + "query",
80 + 'zig',
81 + },
82 + auto_install = true,
83 + autotag = { enable = true },
84 + refactor = 'all',
85 + context_commentstring = { enable = true, enable_autocmd = false },
86 + highlight = {
87 + enable = true,
88 + disable = function(lang, buf)
89 + local max_filesize = 1000 * 1024 -- 1000 KiB
90 + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
91 + if ok and stats and stats.size > max_filesize then
92 + return true
93 + end
94 + end,
95 + additional_vim_regex_highlighting = false,
96 + },
97 + -- TODO what does this do?
98 + incremental_selection = { enable = true },
99 + indent = { enable = true },
100 + lsp_interop = {
101 + enable = true,
102 + border = 'rounded',
103 + peek_definition_code = {
104 + ['<leader>df'] = '@function.outer',
105 + ['<leader>dc'] = '@class.outer',
106 + },
107 + },
108 + textsubjects = {
109 + enable = true,
110 + prev_selection = '<Down>', -- (Optional) keymap to select the previous selection
111 + keymaps = {
112 + ['<Up>'] = 'textsubjects-smart',
113 + ['<Right>'] = 'textsubjects-container-outer',
114 + ['<Left>'] = 'textsubjects-container-inner',
115 + },
116 + },
117 + -- TODO how to learn those?
118 + textobjects = {
119 + select = {
120 + enable = true,
121 + lookahead = true,
122 + keymaps = {
123 + ["ak"] = { query = "@block.outer", desc = "around block" },
124 + ["ik"] = { query = "@block.inner", desc = "inside block" },
125 + ["ac"] = { query = "@class.outer", desc = "around class" },
126 + ["ic"] = { query = "@class.inner", desc = "inside class" },
127 + ["a?"] = { query = "@conditional.outer", desc = "around conditional" },
128 + ["i?"] = { query = "@conditional.inner", desc = "inside conditional" },
129 + ["af"] = { query = "@function.outer", desc = "around function " },
130 + ["if"] = { query = "@function.inner", desc = "inside function " },
131 + ["al"] = { query = "@loop.outer", desc = "around loop" },
132 + ["il"] = { query = "@loop.inner", desc = "inside loop" },
133 + ["aa"] = { query = "@parameter.outer", desc = "around argument" },
134 + ["ia"] = { query = "@parameter.inner", desc = "inside argument" },
135 + },
136 + },
137 + --TODO learn to use move and swap
138 + move = {
139 + enable = true,
140 + set_jumps = true,
141 + goto_next_start = {
142 + ["]k"] = { query = "@block.outer", desc = "Next block start" },
143 + ["]f"] = { query = "@function.outer", desc = "Next function start" },
144 + ["]a"] = { query = "@parameter.inner", desc = "Next argument start" },
145 + },
146 + goto_next_end = {
147 + ["]K"] = { query = "@block.outer", desc = "Next block end" },
148 + ["]F"] = { query = "@function.outer", desc = "Next function end" },
149 + ["]A"] = { query = "@parameter.inner", desc = "Next argument end" },
150 + },
151 + goto_previous_start = {
152 + ["[k"] = { query = "@block.outer", desc = "Previous block start" },
153 + ["[f"] = { query = "@function.outer", desc = "Previous function start" },
154 + ["[a"] = { query = "@parameter.inner", desc = "Previous argument start" },
155 + },
156 + goto_previous_end = {
157 + ["[K"] = { query = "@block.outer", desc = "Previous block end" },
158 + ["[F"] = { query = "@function.outer", desc = "Previous function end" },
159 + ["[A"] = { query = "@parameter.inner", desc = "Previous argument end" },
160 + },
161 + },
162 + swap = {
163 + enable = true,
164 + swap_next = {
165 + [">K"] = { query = "@block.outer", desc = "Swap next block" },
166 + [">F"] = { query = "@function.outer", desc = "Swap next function" },
167 + [">A"] = { query = "@parameter.inner", desc = "Swap next argument" },
168 + },
169 + swap_previous = {
170 + ["<K"] = { query = "@block.outer", desc = "Swap previous block" },
171 + ["<F"] = { query = "@function.outer", desc = "Swap previous function" },
172 + ["<A"] = { query = "@parameter.inner", desc = "Swap previous argument" },
173 + },
174 + },
175 + },
176 + playground = {
177 + enable = true,
178 + disable = {},
179 + updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
180 + persist_queries = false, -- Whether the query persists across vim sessions
181 + keybindings = {
182 + toggle_query_editor = 'o',
183 + toggle_hl_groups = 'i',
184 + toggle_injected_languages = 't',
185 + toggle_anonymous_nodes = 'a',
186 + toggle_language_display = 'I',
187 + focus_language = 'f',
188 + unfocus_language = 'F',
189 + update = 'R',
190 + goto_node = '<cr>',
191 + show_help = '?',
192 + },
193 + },
196 + parsers.get_parser_configs().just = {
197 + install_info = {
198 + url = 'https://github.com/IndianBoy42/tree-sitter-just', -- local path or git repo
199 + files = { 'src/parser.c', 'src/scanner.cc' },
200 + branch = 'main',
201 + },
202 + maintainers = { '@IndianBoy42' },
205 + -- FIXME: this aucmd needs to be restricted to buffers where treesitter is loaded
206 + -- Treesitter highlights tend to highlight syntax errors immediately.
207 + -- But that i find distracting while typing.
208 + -- Disable the error highlight while typing, but keep it in normal mode.
209 + auto 'disable_error_highlight_while_typing' {
211 + description = 'Disable the @error highlight while in Insert mode',
212 + events = 'InsertEnter',
213 + pattern = '*',
214 + command = function()
215 + local highlight = require'nvim-treesitter.highlight'
216 + pcall(highlight.detach)
217 + pcall(highlight.set_custom_captures, { error = 'None' })
218 + pcall(highlight.attach)
219 + end,
220 + },
222 + description = 'Enable the @error highlight while in Normal mode',
223 + events = 'InsertLeave',
224 + pattern = '*',
225 + command = function()
226 + local highlight = require'nvim-treesitter.highlight'
227 + pcall(highlight.detach)
228 + pcall(highlight.set_custom_captures, { error = 'TSError' })
229 + pcall(highlight.attach)
230 + end,
231 + },
233 + end,

neovim/lua/bugabinga/treesitter.lua

Deleted
deleted file mode 100644
1 -local map = require 'std.keymap'
2 -local auto = require 'std.auto'
3 -local want = require 'std.want'
5 -require'bugabinga.health'.add_dependency
6 -{
7 - name = 'CMake',
8 - name_of_executable = 'cmake'
9 -}
11 - name_of_executable = 'make'
14 - name_of_executable = 'zig'
17 - name = 'TreeSitter CLI',
18 - name_of_executable = 'tree-sitter'
21 -want {
22 - 'nvim-treesitter.install',
23 - 'nvim-treesitter.configs',
24 - 'nvim-treesitter.parsers',
25 - 'hlargs',
26 - 'neogen',
27 -}(function(install, configs, parsers, hlargs, neogen)
28 - --install.compilers = { 'zig', 'clang', 'gcc', 'cl', 'cc', vim.fn.getenv 'CC' }
29 - install.prefer_git = true
31 - configs.setup {
32 - -- A list of parser names, or "all"
33 - ensure_installed = 'all',
34 - -- Install parsers asynchronously (only applied to `ensure_installed`)
35 - -- The synchronous install method seems to rely on a posix shell, which i
36 - -- do not use.
37 - sync_install = false,
38 - -- Automatically install missing parsers when entering buffer
39 - auto_install = true,
41 - highlight = {
42 - -- `false` will disable the whole extension
43 - enable = true,
44 - disable = {},
46 - -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
47 - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
48 - -- Using this option may slow down your editor, and you may see some duplicate highlights.
49 - -- Instead of true it can also be a list of languages
50 - additional_vim_regex_highlighting = false,
51 - },
52 - incremental_selection = {
53 - enable = true,
54 - keymaps = {
55 - init_selection = 'gnn',
56 - node_incremental = 'grn',
57 - scope_incremental = 'grc',
58 - node_decremental = 'grm',
59 - },
60 - },
61 - -- indent on = with TS
62 - indent = {
63 - enable = true,
64 - },
65 - -- These features are mostly useful when there is treesitter parser, but no
66 - -- LSP.
67 - -- FIXME: harmonize the keybinds with LSP equivalents
68 - refactor = 'all',
69 - textsubjects = {
70 - enable = true,
71 - prev_selection = '<Down>', -- (Optional) keymap to select the previous selection
72 - keymaps = {
73 - ['<Up>'] = 'textsubjects-smart',
74 - ['<Right>'] = 'textsubjects-container-outer',
75 - ['<Left>'] = 'textsubjects-container-inner',
76 - },
77 - },
78 - textobjects = {
79 - select = {
80 - enable = true,
81 - -- Automatically jump forward to textobj, similar to targets.vim
82 - lookahead = true,
83 - keymaps = {
84 - -- You can use the capture groups defined in textobjects.scm
85 - ['af'] = '@function.outer',
86 - ['if'] = '@function.inner',
87 - ['ac'] = '@class.outer',
88 - ['ic'] = '@class.inner',
89 - },
90 - },
91 - swap = {
92 - enable = true,
93 - swap_next = {
94 - ['<leader>a'] = '@parameter.inner',
95 - },
96 - swap_previous = {
97 - ['<leader>A'] = '@parameter.inner',
98 - },
99 - },
100 - move = {
101 - enable = true,
102 - set_jumps = true, -- whether to set jumps in the jumplist
103 - goto_next_start = {
104 - [']m'] = '@function.outer',
105 - [']]'] = '@class.outer',
106 - },
107 - goto_next_end = {
108 - [']M'] = '@function.outer',
109 - [']['] = '@class.outer',
110 - },
111 - goto_previous_start = {
112 - ['[m'] = '@function.outer',
113 - ['[['] = '@class.outer',
114 - },
115 - goto_previous_end = {
116 - ['[M'] = '@function.outer',
117 - ['[]'] = '@class.outer',
118 - },
119 - },
120 - lsp_interop = {
121 - enable = true,
122 - border = 'rounded',
123 - peek_definition_code = {
124 - ['<leader>df'] = '@function.outer',
125 - ['<leader>dc'] = '@class.outer',
126 - },
127 - },
128 - },
129 - playground = {
130 - enable = true,
131 - disable = {},
132 - updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
133 - persist_queries = false, -- Whether the query persists across vim sessions
134 - keybindings = {
135 - toggle_query_editor = 'o',
136 - toggle_hl_groups = 'i',
137 - toggle_injected_languages = 't',
138 - toggle_anonymous_nodes = 'a',
139 - toggle_language_display = 'I',
140 - focus_language = 'f',
141 - unfocus_language = 'F',
142 - update = 'R',
143 - goto_node = '<cr>',
144 - show_help = '?',
145 - },
146 - },
147 - context_commentstring = {
148 - enable = true,
149 - },
150 - -- autoclose and rename tags
151 - autotag = {
152 - enable = true,
153 - },
154 - }
156 - parsers.get_parser_configs().just = {
157 - install_info = {
158 - url = 'https://github.com/IndianBoy42/tree-sitter-just', -- local path or git repo
159 - files = { 'src/parser.c', 'src/scanner.cc' },
160 - branch = 'main',
161 - },
162 - maintainers = { '@IndianBoy42' },
163 - }
165 - -- highlight function arguments
166 - -- TODO: define color
167 - hlargs.setup()
169 - -- generate doc comment annotations
170 - -- TODO: setup keybind
171 - neogen.setup {
172 - snippet_engine = 'luasnip',
173 - }
175 - map.normal {
176 - name = 'Generate Doc Comment for Function',
177 - category = "editing",
178 - keys = '<leader>' .. 'n' .. 'f',
179 - command = function()
180 - neogen.generate { type = 'func' }
181 - end,
182 - }
183 - map.normal {
184 - name = 'Generate Doc Comment for File',
185 - category = "editing",
186 - keys = '<leader>' .. 'n' .. 'f' .. 'f',
187 - command = function()
188 - neogen.generate { type = 'file' }
189 - end,
190 - }
191 - map.normal {
192 - name = 'Generate Doc Comment for Class',
193 - category = "editing",
194 - keys = '<leader>' .. 'n' .. 'c',
195 - command = function()
196 - neogen.generate { type = 'class' }
197 - end,
198 - }
200 - -- FIXME: this aucmd needs to be restricted to buffers where treesitter is loaded
201 - -- Treesitter highlights tend to highlight syntax errors immediately.
202 - -- But that i find distracting while typing.
203 - -- Disable the error highlight while typing, but keep it in normal mode.
204 - auto 'disable_error_highlight_while_typing' {
205 - {
206 - description = 'Disable the @error highlight while in Insert mode',
207 - events = 'InsertEnter',
208 - pattern = '*',
209 - command = function()
210 - want { 'nvim-treesitter.highlight' }(function(highlight)
211 - pcall(highlight.detach)
212 - pcall(highlight.set_custom_captures, { error = 'None' })
213 - pcall(highlight.attach)
214 - end)
215 - end,
216 - },
217 - {
218 - description = 'Enable the @error highlight while in Normal mode',
219 - events = 'InsertLeave',
220 - pattern = '*',
221 - command = function()
222 - want { 'nvim-treesitter.highlight' }(function(highlight)
223 - pcall(highlight.detach)
224 - pcall(highlight.set_custom_captures, { error = 'TSError' })
225 - pcall(highlight.attach)
226 - end)
227 - end,
228 - },
229 - }
230 -end)

neovim/lua/std/want.lua

Modified
2 2 --- attempts to import modules with the given names.
3 3 ---@param module_names table name or list of names, or a function that returns those
4 4 ---@return function function that takes a function that takes in the modules listed by `module_names`
5 5 return function(module_names)
6 - return function(block)
6 + return function(block, error_handler)
7 7 local loaded_modules = {}
8 8 local failed_modules = {}
9 + if type(module_names) == "string" then
10 + module_names = { module_names }
11 + end
9 12 for _, name in pairs(module_names) do
10 13 local status_ok, module = pcall(require, name)
11 14 if status_ok then
17 20 vim.notify('A wanted module failed to load: ' .. module, 'error')
19 22 if #failed_modules > 0 then
20 - return
23 + return error_handler and error_handler(unpack(failed_modules))
22 25 return block and block(unpack(loaded_modules))

toolbox.symlinks

Added
new file mode 100644
1 +git/gitconfig
2 +~/.config/git/config
4 +git/gitconfig.linux
5 +~/.config/git/.gitconfig.include
7 +cargo/config.toml
8 +~/.cargo/config.toml
10 +nushell/completions
11 +~/.config/nushell/completions
13 +nushell/config.nu
14 +~/.config/nushell/config.nu
16 +nushell/env.nu
17 +~/.config/nushell/env.nu
19 +nushell/modules
20 +~/.config/nushell/modules
22 +nushell/plugin.nu
23 +~/.config/nushell/plugin.nu
25 +icc/thinkpad_x230.icc
26 +~/.config/icc/thinkpad_x230.icc
28 +indexa/config.linux.toml
29 +~/.config/indexa/config.toml
31 +topgrade/topgrade.linux.toml
32 +~/.config/topgrade.toml
34 +stackoverflow/so
35 +~/.config/so
37 +wezterm
38 +~/.config/wezterm
40 +wezterm/wezterm.service
41 +~/.config/systemd/user/wezterm.service
43 +helix/config.toml
44 +~/.config/helix/config.toml
46 +helix/languages.toml
47 +~/.config/helix/languages.toml
49 +helix/themes
50 +~/.config/helix/themes
52 +helix/systemd/helix-dark-mode.service
53 +~/.config/systemd/user/helix-dark-mode.service
55 +xplr
56 +~/.config/xplr
58 +river
59 +~/.config/river
61 +ssh/config
62 +~/.ssh/config
64 +neovim
65 +~/.config/nvim