repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: big rip plugins cleanup

a595e96bd6e1cc2be42dea3689c767c7375c2cd3

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (26)

neovim/.editorconfig

Modified
32 32 table_separator_style = comma
34 34 #optional keep/never/always/smart
35 -trailing_table_separator = always
35 +trailing_table_separator = smart
37 37 # keep/remove/remove_table_only/remove_string_only
38 38 call_arg_parentheses = remove

neovim/.lsp.settings.lua

Modified
1 1 return {
2 2 LuaLS = {
3 3 Lua = {
4 - diagnostics = { globals = { 'vim', 'prequire', }, },
5 - runtime = { version = 'LuaJIT', },
6 - workspace = {
7 - library = vim.api.nvim_get_runtime_file("",true),
8 - },
4 + diagnostics = { globals = { 'vim', 'prequire' } },
5 + runtime = { version = 'LuaJIT' },
6 + workspace = {},

neovim/README.md

Modified
39 39 # todo
41 +* navic highlights do not fit winbar
42 +* indent line bg overwrites visual selection bg
43 +* fix bg gihlight of treesitter-context
44 +* make highlights more visible when expanding snippets
41 45 * make assignment to map.x fail, e.g. `map.normal = {}`...
42 46 * figure out desirable cmp key maps
43 47 * try loading lsp async for better startup perf
44 -* navic highlights do not fit winbar
45 -* add nu-check to nvim-lint
46 -* add nu lsp
47 -* make highlights more visible when expanding snippets
48 -* cursor restore position on (session?) load jumps one location to somewhere
49 - after correct location
50 48 * check out `vim.snippet`
51 -* use `vim.base64` in wezterm plugin
52 -* integrate language tool?
53 49 * adapt config to respect `vim.g.nerdfont` (std.constants?)
54 50 * Do I want multiple LSPs per buffer?
55 51 In case of markdown and text it seems useful, for code it seems like a
56 52 headache...
53 + But it seems inevitable, because more and more tools use the LSP infrastructure.
54 + For example, grammar checkers like harper or code transform tools like ast-grep
55 +* check out harper-ls
56 +* check out ast-grep
57 57 * flesh out 'const.lua', move to std?
58 58 * nvim spell for camel case words
59 59 * create skeleton-plugin for default file content based on file type

neovim/ftplugin/lua.lua

Modified
2 2 -- Options to add `gf` functionality inside `.lua` files.
3 3 vim.opt_local.include = [[\v<((do|load)file|require)[^''"]*[''"]\zs[^''"]+]]
4 4 vim.opt_local.includeexpr = "substitute(v:fname,'\\.','/','g')"
5 5 for _, path in pairs( vim.api.nvim_list_runtime_paths() ) do
6 - vim.opt_local.path:append( path .. '/lua' )
6 + vim.opt_local.path:append( path .. '/lua' )
7 7 end
8 8 vim.opt_local.suffixesadd:prepend '.lua'
10 +-- i like to mask some lua keywords with cool unicode chars
11 +-- those are defined in 'after/queries/lua/highlights.scm'
9 12 vim.opt_local.conceallevel = 1
10 13 vim.opt_local.concealcursor = 'n'

neovim/lua/bugabinga/lsp/init.lua

Modified
15 15 require 'bugabinga.lsp.lightbulb'
17 17 local token_update = function ( lsp_client )
18 - local token = lsp_client.data.token
19 - local buffer = lsp_client.buffer
20 - local client_id = lsp_client.data.client_id
21 - local mutable_variable_highlight = 'MutableVariable'
18 + local token = lsp_client.data.token
19 + local buffer = lsp_client.buffer
20 + local client_id = lsp_client.data.client_id
21 + local mutable_variable_highlight = 'MutableVariable'
23 - if token.type == 'variable' and not token.modifiers.readonly then
24 - vim.lsp.semantic_tokens.highlight_token( token, buffer, client_id, mutable_variable_highlight )
25 - end
23 + if token.type == 'variable' and not token.modifiers.readonly then
24 + vim.lsp.semantic_tokens.highlight_token( token, buffer, client_id, mutable_variable_highlight )
25 + end
27 - --TODO: find more use cases for semantic tokens
28 - --* global variables
29 - --* functions with side effects
30 - --* closures that capture something
27 + --TODO: find more use cases for semantic tokens
28 + --* global variables
29 + --* functions with side effects
30 + --* closures that capture something
33 33 local expand_path = function ( path )
34 - if vim.fn.executable( path ) == 1 then
35 - return vim.fn.exepath( path )
36 - else
37 - return path
38 - end
34 + if vim.fn.executable( path ) == 1 then
35 + return vim.fn.exepath( path )
36 + else
37 + return path
38 + end
41 41 local expand_command = function ( command )
42 - vim.validate { command = { command, { 'string', 'table', }, }, }
42 + vim.validate { command = { command, { 'string', 'table' } } }
44 - if type( command ) == 'table' then
45 - command[1] = expand_path( command[1] )
46 - return command
47 - end
44 + if type( command ) == 'table' then
45 + command[1] = expand_path( command[1] )
46 + return command
47 + end
49 - return expand_path( command )
49 + return expand_path( command )
52 52 local lsp_start = function ( file_type_event )
53 - dbg.print 'trying to start lsp'
54 - local match = file_type_event.match
53 + dbg.print 'trying to start lsp'
54 + local match = file_type_event.match
56 - dbg.print( 'filetypes to ignore', ignored.filetypes, 'current filetype', match )
57 - if vim.iter( ignored.filetypes ):find( match ) then return end
56 + dbg.print( 'filetypes to ignore', ignored.filetypes, 'current filetype', match )
57 + if vim.iter( ignored.filetypes ):find( match ) then return end
59 - local bufnr = file_type_event.buf
60 - local buftype = vim.api.nvim_get_option_value( 'buftype', { buf = bufnr, } )
61 - dbg.print( 'buftypes to ignore', ignored.buftypes, 'current buftype', buftype )
62 - if vim.iter( ignored.buftypes ):find( buftype ) then return end
59 + local bufnr = file_type_event.buf
60 + local buftype = vim.api.nvim_get_option_value( 'buftype', { buf = bufnr } )
61 + dbg.print( 'buftypes to ignore', ignored.buftypes, 'current buftype', buftype )
62 + if vim.iter( ignored.buftypes ):find( buftype ) then return end
64 - local buffer_path = vim.api.nvim_buf_get_name( bufnr )
64 + local buffer_path = vim.api.nvim_buf_get_name( bufnr )
66 - dbg.print( string.format( 'searching lsp client for: match: %s, buffer: %s, path: %s', match, bufnr, buffer_path ) )
66 + dbg.print( string.format( 'searching lsp client for: match: %s, buffer: %s, path: %s', match, bufnr, buffer_path ) )
68 - local potential_client_configs = vim.iter( lsp_client_configs )
69 - :map( function ( config )
70 - vim.validate {
71 - ['config'] = { config, 'table', },
72 - ['config.name'] = { config.name, 'string', },
73 - ['config.filetypes'] = { config.filetypes, { 'string', 'table', }, },
74 - ['config.command'] = { config.command, { 'string', 'table', }, },
75 - ['config.environment'] = { config.environment, 'table', true, },
76 - ['config.root_dir'] = { config.root_dir, 'function', 'string', },
77 - ['config.single_file_support'] = { config.single_file_support, 'boolean', true, },
78 - ['config.settings'] = { config.settings, 'table', true, },
79 - ['config.workspaces'] = { config.workspaces, 'boolean', true, },
80 - ['config.before_init'] = { config.before_init, {'function', 'table'}, true, },
81 - ['config.init_options'] = { config.init_options, 'table', true, },
82 - ['config.capabilities'] = { config.capabilities, 'table', true, },
83 - ['config.custom_start'] = { config.custom_start, 'function', true, },
84 - }
85 - -- normalize scalar values to its vector alternative for easier processing later on
86 - -- this mutates the lsp client configs! careful!
87 - config.command = type( config.command ) == 'string' and { expand_command( config.command ), } or
88 - expand_command( config.command )
89 - config.environment = config.environment or {}
90 - config.filetypes = type( config.filetypes ) == 'string' and { config.filetypes, } or config.filetypes
91 - config.single_file_support = config.single_file_support == nil and false or config.single_file_support
92 - config.workspaces = config.workspaces == nil and false or config.workspaces
93 - config.capabilities = config.capabilities or {}
94 - config.init_options = config.init_options or {}
68 + local potential_client_configs = vim.iter( lsp_client_configs )
69 + :map( function ( config )
70 + vim.validate {
71 + ['config'] = { config, 'table' },
72 + ['config.name'] = { config.name, 'string' },
73 + ['config.filetypes'] = { config.filetypes, { 'string', 'table' } },
74 + ['config.command'] = { config.command, { 'string', 'table' } },
75 + ['config.environment'] = { config.environment, 'table', true },
76 + ['config.root_dir'] = { config.root_dir, 'function', 'string' },
77 + ['config.single_file_support'] = { config.single_file_support, 'boolean', true },
78 + ['config.settings'] = { config.settings, 'table', true },
79 + ['config.workspaces'] = { config.workspaces, 'boolean', true },
80 + ['config.before_init'] = { config.before_init, { 'function', 'table' }, true },
81 + ['config.init_options'] = { config.init_options, 'table', true },
82 + ['config.capabilities'] = { config.capabilities, 'table', true },
83 + ['config.custom_start'] = { config.custom_start, 'function', true },
84 + }
85 + -- normalize scalar values to its vector alternative for easier processing later on
86 + -- this mutates the lsp client configs! careful!
87 + config.command = type( config.command ) == 'string' and { expand_command( config.command ) } or
88 + expand_command( config.command )
89 + config.environment = config.environment or {}
90 + config.filetypes = type( config.filetypes ) == 'string' and { config.filetypes } or config.filetypes
91 + config.single_file_support = config.single_file_support == nil and false or config.single_file_support
92 + config.workspaces = config.workspaces == nil and false or config.workspaces
93 + config.capabilities = config.capabilities or {}
94 + config.init_options = config.init_options or {}
96 - return config
97 - end )
98 - :filter( function ( config )
99 - return vim.iter( config.filetypes ):find( match )
100 - end )
101 - :totable()
96 + return config
97 + end )
98 + :filter( function ( config )
99 + return vim.iter( config.filetypes ):find( match )
100 + end )
101 + :totable()
103 - dbg.print( 'POTENTIAL CLIENTS',
104 - vim.iter( potential_client_configs ):map( function ( config )
105 - return {
106 - name = config.name,
107 - command =
108 - config.command,
109 - }
110 - end )
111 - :totable() )
103 + dbg.print( 'POTENTIAL CLIENTS',
104 + vim.iter( potential_client_configs ):map( function ( config )
105 + return {
106 + name = config.name,
107 + command =
108 + config.command,
110 + end )
111 + :totable() )
113 - if table.is_empty( potential_client_configs ) then
114 - dbg.print( 'found no lsp client for', buffer_path )
115 - return
116 - end
113 + if table.is_empty( potential_client_configs ) then
114 + dbg.print( 'found no lsp client for', buffer_path )
115 + return
116 + end
118 - --NOTE: this is super kool but has the limitation, that only lsp clients
119 - -- configured via my special lsp module are affected.
120 - local project_local_lsp_settings = localrc( '.lsp.settings.lua', 'table' ) or {}
121 - local project_local_workspace_folders = localrc( '.lsp.workspace_folders.lua', 'table' ) or {}
118 + --NOTE: this is super kool but has the limitation, that only lsp clients
119 + -- configured via my special lsp module are affected.
120 + local project_local_lsp_settings = localrc( '.lsp.settings.lua', 'table' ) or {}
121 + local project_local_workspace_folders = localrc( '.lsp.workspace_folders.lua', 'table' ) or {}
123 - -- expand relative workspace paths into lsp.workspaceFolders (name + uri)
124 - for lsp, folders in pairs( project_local_workspace_folders ) do
125 - for idx, path in ipairs( folders ) do
126 - local cwd = vim.uv.cwd()
127 - local abs_path = vim.fs.normalize( vim.fs.joinpath( cwd, path ) )
123 + -- expand relative workspace paths into lsp.workspaceFolders (name + uri)
124 + for lsp, folders in pairs( project_local_workspace_folders ) do
125 + for idx, path in ipairs( folders ) do
126 + local cwd = vim.uv.cwd()
127 + local abs_path = vim.fs.normalize( vim.fs.joinpath( cwd, path ) )
129 - local exists = vim.uv.fs_stat( abs_path )
130 - if not exists or exists.type ~= 'directory' then
131 - vim.error( 'the project local workspace folder ' ..
132 - abs_path .. ' does not exist or is not a directory.' )
133 - end
129 + local exists = vim.uv.fs_stat( abs_path )
130 + if not exists or exists.type ~= 'directory' then
131 + vim.error( 'the project local workspace folder ' ..
132 + abs_path .. ' does not exist or is not a directory.' )
133 + end
135 - project_local_workspace_folders[lsp][idx] = { uri = 'file://' .. abs_path, name = path, }
136 - end
137 - end
135 + project_local_workspace_folders[lsp][idx] = { uri = 'file://' .. abs_path, name = path }
136 + end
137 + end
139 - dbg.print( 'patched project local workspace folders', project_local_workspace_folders )
139 + dbg.print( 'patched project local workspace folders', project_local_workspace_folders )
141 - for _, config in ipairs( potential_client_configs ) do
142 - local path = type( config.command ) == 'table' and config.command[1] or config.command
143 - if vim.fn.executable( path ) ~= 1 then
144 - vim.notify( 'The LSP ' .. config.name .. ' does not seem to be installed!' )
145 - break
146 - end
141 + for _, config in ipairs( potential_client_configs ) do
142 + local path = type( config.command ) == 'table' and config.command[1] or config.command
143 + if vim.fn.executable( path ) ~= 1 then
144 + vim.notify( 'The LSP ' .. config.name .. ' does not seem to be installed!' )
145 + break
146 + end
148 - local capabilities = vim.lsp.protocol.make_client_capabilities()
149 - capabilities = table.extend( 'force', capabilities, config.capabilities )
148 + local capabilities = vim.lsp.protocol.make_client_capabilities()
149 + capabilities = table.extend( 'force', capabilities, config.capabilities )
151 - local settings = config.settings
152 - local settings_override = project_local_lsp_settings[config.name]
153 - if settings_override then
154 - dbg.print( 'overriding settings with project local settings', settings, settings_override )
155 - settings = vim.tbl_deep_extend( 'force', settings, settings_override )
156 - end
151 + local settings = config.settings
152 + local settings_override = project_local_lsp_settings[config.name]
153 + if settings_override then
154 + dbg.print( 'overriding settings with project local settings', settings, settings_override )
155 + settings = vim.tbl_deep_extend( 'force', settings, settings_override )
156 + end
158 158 local root_dir = type( config.root_dir ) == 'string' and config.root_dir or config.root_dir( buffer_path )
159 - local root_workspace = root_dir and { uri = 'file://' .. root_dir, name = root_dir, } or nil
160 - local workspace_folders = root_workspace and { root_workspace, } or nil
161 - local workspace_folders_local = project_local_workspace_folders[config.name]
162 - if not workspace_folders_local then dbg.print( 'no local workspace folders found for ' .. config.name ) end
163 - if workspace_folders_local and config.workspaces then
164 - dbg.print( 'setting workspace folders to project local workspace folders', workspace_folders_local )
165 - workspace_folders = workspace_folders and
166 - vim.tbl_deep_extend( 'force', workspace_folders, workspace_folders_local ) or workspace_folders_local
167 - end
159 + local root_workspace = root_dir and { uri = 'file://' .. root_dir, name = root_dir } or nil
160 + local workspace_folders = root_workspace and { root_workspace } or nil
161 + local workspace_folders_local = project_local_workspace_folders[config.name]
162 + if not workspace_folders_local then dbg.print( 'no local workspace folders found for ' .. config.name ) end
163 + if workspace_folders_local and config.workspaces then
164 + dbg.print( 'setting workspace folders to project local workspace folders', workspace_folders_local )
165 + workspace_folders = workspace_folders and
166 + vim.tbl_deep_extend( 'force', workspace_folders, workspace_folders_local ) or workspace_folders_local
167 + end
169 - dbg.print( 'starting command:', config.command )
169 + dbg.print( 'starting command:', config.command )
171 - local start_config = {
172 - cmd = config.command,
173 - cmd_cwd = root_dir,
174 - -- cmd_env = config.environment,
175 - detached = false, -- do i want this?
176 - root_dir = root_dir,
177 - workspace_folders = workspace_folders,
178 - capabilities = capabilities,
179 - -- handlers = vim.lsp.handlers,
180 - settings = settings,
181 - -- commands = nil, -- what is this?
182 - init_options = config.init_options,
183 - name = config.name,
184 - -- get_language_id = nil,
185 - -- offset_encoding = nil,
186 - on_error = function ( code, ... ) vim.print( 'LSP ERROR', code, ... ) end,
187 - before_init = config.before_init,
188 - -- on_init = nil, -- should i send workspace/didChangeConfiguration here?
189 - on_exit = function ( code, signal, client_id ) dbg.print( 'LSP CLIENT EXIT', code, signal, client_id ) end,
190 - on_attach = function ( client, attach_bufnr ) dbg.print( 'LSP CLIENT ATTACH', client, attach_bufnr ) end,
191 - trace = dbg.get() and 'on' or 'off',
192 - flags = { allow_incremental_sync = true, debounce_text_changes = 250, exit_timeout = 200, },
193 - }
171 + local start_config = {
172 + cmd = config.command,
173 + cmd_cwd = root_dir,
174 + -- cmd_env = config.environment,
175 + detached = false, -- do i want this?
176 + root_dir = root_dir,
177 + workspace_folders = workspace_folders,
178 + capabilities = capabilities,
179 + -- handlers = vim.lsp.handlers,
180 + settings = settings,
181 + -- commands = nil, -- what is this?
182 + init_options = config.init_options,
183 + name = config.name,
184 + -- get_language_id = nil,
185 + -- offset_encoding = nil,
186 + on_error = function ( code, ... ) vim.print( 'LSP ERROR', code, ... ) end,
187 + before_init = config.before_init,
188 + -- on_init = nil, -- should i send workspace/didChangeConfiguration here?
189 + on_exit = function ( code, signal, client_id ) dbg.print( 'LSP CLIENT EXIT', code, signal, client_id ) end,
190 + on_attach = function ( client, attach_bufnr ) dbg.print( 'LSP CLIENT ATTACH', client, attach_bufnr ) end,
191 + trace = dbg.get() and 'on' or 'off',
192 + flags = { allow_incremental_sync = true, debounce_text_changes = 250, exit_timeout = 200 },
195 - local lsp_starter = config.custom_start or vim.lsp.start
195 + local lsp_starter = config.custom_start or vim.lsp.start
197 - dbg.print( 'starting lsp', start_config.name, root_dir )
197 + dbg.print( 'starting lsp', start_config.name, root_dir )
199 - lsp_starter( start_config, {
200 - bufnr = bufnr,
201 - -- TODO: reuse if workspaces
202 - -- local supported = vim.tbl_get(client, 'server_capabilities', 'workspace', 'workspaceFolders', 'supported')
203 - reuse_client = function ( existing_client, new_config )
204 - dbg.print(
205 - 'lsp reuse client',
206 - existing_client.name,
207 - existing_client.workspace_folders,
208 - new_config.name,
209 - new_config.root_dir
210 - )
199 + lsp_starter( start_config, {
200 + bufnr = bufnr,
201 + -- TODO: reuse if workspaces
202 + -- local supported = vim.tbl_get(client, 'server_capabilities', 'workspace', 'workspaceFolders', 'supported')
203 + reuse_client = function ( existing_client, new_config )
204 + dbg.print(
205 + 'lsp reuse client',
206 + existing_client.name,
207 + existing_client.workspace_folders,
208 + new_config.name,
209 + new_config.root_dir
212 - --TODO lsps with single file or worksopaces support do not need smame root dir. instead add_workspace_folder
213 - local same_name = existing_client.name == new_config.name
212 + --TODO lsps with single file or worksopaces support do not need smame root dir. instead add_workspace_folder
213 + local same_name = existing_client.name == new_config.name
215 - local new_root_raw = new_config.root_dir or nil
216 - local existing_root_raw = existing_client.workspace_folders and #existing_client.workspace_folders >= 1 and
217 - existing_client.workspace_folders[1].name or nil
215 + local new_root_raw = new_config.root_dir or nil
216 + local existing_root_raw = existing_client.workspace_folders and #existing_client.workspace_folders >= 1 and
217 + existing_client.workspace_folders[1].name or nil
219 - if not (new_root_raw and existing_root_raw) then return false end
219 + if not (new_root_raw and existing_root_raw) then return false end
221 - local new_root = vim.fs.normalize( new_root_raw )
222 - local existing_root = vim.fs.normalize( existing_root_raw )
223 - local same_root = new_root == existing_root
221 + local new_root = vim.fs.normalize( new_root_raw )
222 + local existing_root = vim.fs.normalize( existing_root_raw )
223 + local same_root = new_root == existing_root
225 - local reuse = same_name and same_root
226 - dbg.print( 'reusing lsp client?', reuse )
227 - return reuse
228 - end,
229 - } )
225 + local reuse = same_name and same_root
226 + dbg.print( 'reusing lsp client?', reuse )
227 + return reuse
228 + end,
229 + } )
231 - dbg.print( 'STARTING LSP CLIENT', config.name )
232 - end
231 + dbg.print( 'STARTING LSP CLIENT', config.name )
232 + end
235 235 local old_formatexpr
239 239 local keybinds = {}
240 240 local add = function ( client_id, keybind_remover )
241 - vim.validate {
242 - client_id = { client_id, 'number', },
243 - keybind_remover = { keybind_remover, 'function', },
244 - }
245 - if not table.contains( keybinds, client_id ) then
246 - keybinds[client_id] = {}
247 - end
248 - table.insert( keybinds[client_id], keybind_remover )
241 + vim.validate {
242 + client_id = { client_id, 'number' },
243 + keybind_remover = { keybind_remover, 'function' },
245 + if not table.contains( keybinds, client_id ) then
246 + keybinds[client_id] = {}
247 + end
248 + table.insert( keybinds[client_id], keybind_remover )
251 251 local lsp_attach = function ( args )
252 - local bufnr = args.buf
253 - local client_id = args.data.client_id
254 - local client = vim.lsp.get_client_by_id( client_id )
255 - if not client then return end
252 + local bufnr = args.buf
253 + local client_id = args.data.client_id
254 + local client = vim.lsp.get_client_by_id( client_id )
255 + if not client then return end
257 - dbg.print( client.server_capabilities )
257 + dbg.print( client.server_capabilities )
259 - if client.server_capabilities.definitionProvider then
260 - old_tagfunc = vim.bo[bufnr].tagfunc
261 - vim.bo[bufnr].tagfunc = 'v:lua.vim.lsp.tagfunc'
262 - end
259 + if client.server_capabilities.definitionProvider then
260 + old_tagfunc = vim.bo[bufnr].tagfunc
261 + vim.bo[bufnr].tagfunc = 'v:lua.vim.lsp.tagfunc'
262 + end
264 - if client.server_capabilities.documentFormattingProvider then
265 - old_formatexpr = vim.bo[bufnr].formatexpr
266 - vim.bo[bufnr].formatexpr = 'v:lua.vim.lsp.formatexpr'
267 - end
264 + if client.server_capabilities.documentFormattingProvider then
265 + old_formatexpr = vim.bo[bufnr].formatexpr
266 + vim.bo[bufnr].formatexpr = 'v:lua.vim.lsp.formatexpr'
267 + end
269 - if client.server_capabilities.completionProvider then
270 - old_omnifunc = vim.bo[bufnr].omnifunc
271 - vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc'
272 - end
269 + if client.server_capabilities.completionProvider then
270 + old_omnifunc = vim.bo[bufnr].omnifunc
271 + vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc'
272 + end
274 - if client.server_capabilities.documentSymbolProvider then
275 - local navic_ok, navic = pcall( require, 'nvim-navic' )
276 - if navic_ok then
277 - navic.attach( client, bufnr )
278 - else
279 - vim.notify 'nvim-navic not found. could not attach to lsp client.'
280 - end
281 - local navbuddy_ok, navbuddy = pcall( require, 'nvim-navbuddy' )
282 - if navbuddy_ok then
283 - navbuddy.attach( client, bufnr )
284 - map.normal {
285 - description = 'Open overview of symbols in current buffer',
286 - category = 'lsp',
287 - keys = '<leader>lo',
288 - command = function () navbuddy.open( bufnr ) end,
289 - buffer = bufnr,
290 - }
291 - else
292 - vim.notify 'nvim-navbuddy not found. could not attach to lsp client.'
293 - end
294 - end
274 + if client.server_capabilities.documentHighlightProvider then
275 + -- the timer has application lifetime. no need to close
276 + local delay = 300
277 + local debounced_highlight = defer.debounce_leading( vim.lsp.buf.document_highlight, delay )
278 + local debounced_clear = defer.debounce_leading( vim.lsp.buf.clear_references, delay )
296 - if client.server_capabilities.documentHighlightProvider then
297 - -- the timer has application lifetime. no need to close
298 - local delay = 300
299 - local debounced_highlight = defer.debounce_leading( vim.lsp.buf.document_highlight, delay )
300 - local debounced_clear = defer.debounce_leading( vim.lsp.buf.clear_references, delay )
280 + auto 'document_highlight' {
282 + description = 'Highlight symbol under cursor on hold',
283 + events = 'CursorHold',
284 + buffer = bufnr,
285 + command = debounced_highlight,
286 + },
288 + description = 'Remove highlight from symbol under cursor on move',
289 + events = { 'CursorMoved', 'InsertEnter' },
290 + buffer = bufnr,
291 + command = debounced_clear,
292 + },
294 + end
302 - auto 'document_highlight' {
303 - {
304 - description = 'Highlight symbol under cursor on hold',
305 - events = 'CursorHold',
306 - buffer = bufnr,
307 - command = debounced_highlight,
308 - },
309 - {
310 - description = 'Remove highlight from symbol under cursor on move',
311 - events = { 'CursorMoved', 'InsertEnter', },
312 - buffer = bufnr,
313 - command = debounced_clear,
314 - },
315 - }
316 - end
296 + if client.server_capabilities.inlayHintProvider then
297 + add( client_id, map.normal {
298 + description = 'Toggle inlay hints',
299 + category = 'lsp',
300 + buffer = bufnr,
301 + keys = '<leader>ti',
302 + command = function ()
303 + vim.lsp.inlay_hint.enable( bufnr, nil )
304 + end,
305 + } )
306 + end
318 - if client.server_capabilities.inlayHintProvider then
319 - add( client_id, map.normal {
320 - description = 'Toggle inlay hints',
321 - category = 'lsp',
322 - buffer = bufnr,
323 - keys = '<leader>ti',
324 - command = function ()
325 - vim.lsp.inlay_hint.enable( bufnr, nil )
326 - end,
327 - } )
328 - end
308 + add( client_id, map.normal {
309 + description = 'Show hover documentation above cursor.',
310 + category = 'lsp',
311 + buffer = bufnr,
312 + keys = { 'K', '<leader>lk' },
313 + command = vim.lsp.buf.hover,
314 + } )
330 - add( client_id, map.normal {
331 - description = 'Show hover documentation above cursor.',
332 - category = 'lsp',
333 - buffer = bufnr,
334 - keys = { 'K', '<leader>lk', },
335 - command = vim.lsp.buf.hover,
336 - } )
316 + add( client_id, map.insert {
317 + description = 'Show signature help under cursor.',
318 + category = 'lsp',
319 + buffer = bufnr,
320 + keys = { '<C-h>' },
321 + command = vim.lsp.buf.signature_help,
322 + } )
338 - add( client_id, map.insert {
339 - description = 'Show signature help under cursor.',
340 - category = 'lsp',
341 - buffer = bufnr,
342 - keys = { '<C-h>', },
343 - command = vim.lsp.buf.signature_help,
344 - } )
324 + add( client_id, map.normal {
325 + description = 'Show available code actions on current line.',
326 + category = 'lsp',
327 + buffer = bufnr,
328 + keys = '<leader>la',
329 + command = vim.lsp.buf.code_action,
330 + } )
346 - add( client_id, map.normal {
347 - description = 'Show available code actions on current line.',
348 - category = 'lsp',
349 - buffer = bufnr,
350 - keys = '<leader>la',
351 - command = vim.lsp.buf.code_action,
352 - } )
332 + add( client_id, map.normal {
333 + description = 'Goto to definition of symbol under cursor.',
334 + category = 'lsp',
335 + buffer = bufnr,
336 + keys = '<leader>ld',
337 + command = vim.lsp.buf.definition,
338 + } )
354 - add( client_id, map.normal {
355 - description = 'Goto to definition of symbol under cursor.',
356 - category = 'lsp',
357 - buffer = bufnr,
358 - keys = '<leader>ld',
359 - command = vim.lsp.buf.definition,
360 - } )
340 + add( client_id, map.normal {
341 + description = 'Show implementations of symbol under cursor.',
342 + category = 'lsp',
343 + buffer = bufnr,
344 + keys = '<leader>li',
345 + command = vim.lsp.buf.implementation,
346 + } )
362 - add( client_id, map.normal {
363 - description = 'Show implementations of symbol under cursor.',
364 - category = 'lsp',
365 - buffer = bufnr,
366 - keys = '<leader>li',
367 - command = vim.lsp.buf.implementation,
368 - } )
348 + add( client_id, map.normal {
349 + description = 'Show incoming calls of symbol under cursor.',
350 + category = 'lsp',
351 + buffer = bufnr,
352 + keys = '<leader>lc',
353 + command = vim.lsp.buf.incoming_calls,
354 + } )
370 - add( client_id, map.normal {
371 - description = 'Show incoming calls of symbol under cursor.',
372 - category = 'lsp',
373 - buffer = bufnr,
374 - keys = '<leader>lc',
375 - command = vim.lsp.buf.incoming_calls,
376 - } )
356 + add( client_id, map.normal {
357 + description = 'Show outgoing calls of symbol under cursor.',
358 + category = 'lsp',
359 + buffer = bufnr,
360 + keys = '<leader>lC',
361 + command = vim.lsp.buf.outgoing_calls,
362 + } )
378 - add( client_id, map.normal {
379 - description = 'Show outgoing calls of symbol under cursor.',
380 - category = 'lsp',
381 - buffer = bufnr,
382 - keys = '<leader>lC',
383 - command = vim.lsp.buf.outgoing_calls,
384 - } )
364 + add( client_id, map.normal {
365 + description = 'Show references of symbol under cursor.',
366 + category = 'lsp',
367 + buffer = bufnr,
368 + keys = '<leader>ln',
369 + command = vim.lsp.buf.references,
370 + } )
386 - add( client_id, map.normal {
387 - description = 'Show references of symbol under cursor.',
388 - category = 'lsp',
389 - buffer = bufnr,
390 - keys = '<leader>ln',
391 - command = vim.lsp.buf.references,
392 - } )
394 - add( client_id, map.normal {
395 - description = 'Rename symbol under cursor.',
396 - category = 'lsp',
397 - buffer = bufnr,
398 - keys = { '<f2>', '<leader>lr', },
399 - command = vim.lsp.buf.rename,
400 - } )
372 + add( client_id, map.normal {
373 + description = 'Rename symbol under cursor.',
374 + category = 'lsp',
375 + buffer = bufnr,
376 + keys = { '<f2>', '<leader>lr' },
377 + command = vim.lsp.buf.rename,
378 + } )
403 381 local lsp_detach = function ( args )
404 - dbg.print( 'DETACH LSP', args )
382 + dbg.print( 'DETACH LSP', args )
406 - local bufnr = args.buf
407 - local client_id = args.data.client_id
408 - local client = vim.lsp.get_client_by_id( client_id )
409 - if not client then return end
384 + local bufnr = args.buf
385 + local client_id = args.data.client_id
386 + local client = vim.lsp.get_client_by_id( client_id )
387 + if not client then return end
411 - if client.server_capabilities.definitionProvider then
412 - vim.bo[bufnr].tagfunc = old_tagfunc
413 - end
389 + if client.server_capabilities.definitionProvider then
390 + vim.bo[bufnr].tagfunc = old_tagfunc
391 + end
415 - if client.server_capabilities.documentFormattingProvider then
416 - vim.bo[bufnr].formatexpr = old_formatexpr
417 - end
393 + if client.server_capabilities.documentFormattingProvider then
394 + vim.bo[bufnr].formatexpr = old_formatexpr
395 + end
419 - if client.server_capabilities.completionProvider then
420 - vim.bo[bufnr].omnifunc = old_omnifunc
421 - end
397 + if client.server_capabilities.completionProvider then
398 + vim.bo[bufnr].omnifunc = old_omnifunc
399 + end
423 - if table.contains( keybinds, client_id ) then
424 - for _, keybind_delete in ipairs( keybinds[client_id] ) do
425 - keybind_delete()
426 - end
427 - end
401 + if table.contains( keybinds, client_id ) then
402 + for _, keybind_delete in ipairs( keybinds[client_id] ) do
403 + keybind_delete()
404 + end
405 + end
430 408 auto 'lsp' {
431 - {
432 - description = 'Start or reuse LSP client',
433 - events = 'FileType',
434 - command = lsp_start,
435 - },
436 - {
437 - description = 'Hook: LSP client attached to buffer',
438 - events = 'LspAttach',
439 - command = lsp_attach,
440 - },
441 - {
442 - description = 'Hook: LSP client detached from buffer',
443 - events = 'LspDetach',
444 - command = lsp_detach,
445 - },
446 - {
447 - description = 'Semantic Tokens from the LSP',
448 - events = 'LspTokenUpdate',
449 - command = token_update,
450 - },
410 + description = 'Start or reuse LSP client',
411 + events = 'FileType',
412 + command = lsp_start,
413 + },
415 + description = 'Hook: LSP client attached to buffer',
416 + events = 'LspAttach',
417 + command = lsp_attach,
418 + },
420 + description = 'Hook: LSP client detached from buffer',
421 + events = 'LspDetach',
422 + command = lsp_detach,
423 + },
425 + description = 'Semantic Tokens from the LSP',
426 + events = 'LspTokenUpdate',
427 + command = token_update,
428 + },
453 431 local lsp_info = function ( command )
454 - local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0, }
455 - local active_clients = vim.lsp.get_clients( all_or_current )
432 + local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0 }
433 + local active_clients = vim.lsp.get_clients( all_or_current )
457 - local infos = vim.iter( active_clients )
458 - :map( function ( client )
459 - local name = client.name
460 - local config = vim.iter( lsp_client_configs ):find( function ( config ) return config.name == name end )
461 - assert( config, ('How did we not find a config for %s ?!?!'):format( name ) )
435 + local infos = vim.iter( active_clients )
436 + :map( function ( client )
437 + local name = client.name
438 + local config = vim.iter( lsp_client_configs ):find( function ( config ) return config.name == name end )
439 + assert( config, ('How did we not find a config for %s ?!?!'):format( name ) )
463 - local full_cmd = table.deep_copy( client.config.cmd )
464 - full_cmd[1] = vim.fn.exepath( full_cmd[1] )
465 - local basic = {
466 - id = client.id,
467 - name = name,
468 - cmd = table.concat( full_cmd, ' ' ),
469 - workspace_folders = vim.iter( client.workspace_folders ):map( function ( w ) return vim.fs.normalize( w.name ) end )
470 - :totable(),
471 - filetypes = table.concat( config.filetypes, ', ' ),
472 - single_file_support = config.single_file_support,
473 - workspaces = config.workspaces,
474 - }
475 - return basic
476 - end )
477 - :totable()
441 + local full_cmd = table.deep_copy( client.config.cmd )
442 + full_cmd[1] = vim.fn.exepath( full_cmd[1] )
443 + local basic = {
444 + id = client.id,
445 + name = name,
446 + cmd = table.concat( full_cmd, ' ' ),
447 + workspace_folders = vim.iter( client.workspace_folders ):map( function ( w ) return vim.fs.normalize( w.name ) end )
448 + :totable(),
449 + filetypes = table.concat( config.filetypes, ', ' ),
450 + single_file_support = config.single_file_support,
451 + workspaces = config.workspaces,
453 + return basic
454 + end )
455 + :totable()
479 - ui.show_tree( infos )
457 + ui.show_tree( infos )
482 460 local lsp_info_extended = function ( command )
483 - local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0, }
484 - local active_clients = vim.lsp.get_clients( all_or_current )
485 - ui.show_tree( active_clients )
461 + local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0 }
462 + local active_clients = vim.lsp.get_clients( all_or_current )
463 + ui.show_tree( active_clients )
488 466 user_command.LspInfo
489 467 'Shows basic information about running LSP clients.'
490 - { nargs = '?', complete = function () return { 'all', } end, } (
491 - lsp_info
492 - )
468 + { nargs = '?', complete = function () return { 'all' } end } (
469 + lsp_info
494 472 user_command.LspInfoExtended
495 473 'Shows detailed information about running LSP clients.'
496 - { nargs = '?', complete = function () return { 'all', } end, } (
497 - lsp_info_extended
498 - )
474 + { nargs = '?', complete = function () return { 'all' } end } (
475 + lsp_info_extended
500 478 -- TODO: LspStart
501 479 -- TODO: LspStop
502 480 -- TODO: LspRestart ? Maybe good after changing project local settings?
504 482 local completion_icons = {
505 - Class = icon.class,
506 - Color = icon.color,
507 - Constant = icon.constant,
508 - Constructor = icon.constructor,
509 - Enum = icon.enum,
510 - EnumMember = icon.enum_member,
511 - Field = icon.field,
512 - File = icon.file,
513 - Folder = icon.folder,
514 - Function = icon['function'],
515 - Interface = icon.interface,
516 - Keyword = icon.keyword,
517 - Method = icon.method,
518 - Module = icon.module,
519 - Property = icon.property,
520 - Snippet = icon.snippet,
521 - Struct = icon.struct,
522 - Text = icon.text,
523 - Unit = icon.unit,
524 - Value = icon.value,
525 - Variable = icon.variable,
483 + Class = icon.class,
484 + Color = icon.color,
485 + Constant = icon.constant,
486 + Constructor = icon.constructor,
487 + Enum = icon.enum,
488 + EnumMember = icon.enum_member,
489 + Field = icon.field,
490 + File = icon.file,
491 + Folder = icon.folder,
492 + Function = icon['function'],
493 + Interface = icon.interface,
494 + Keyword = icon.keyword,
495 + Method = icon.method,
496 + Module = icon.module,
497 + Property = icon.property,
498 + Snippet = icon.snippet,
499 + Struct = icon.struct,
500 + Text = icon.text,
501 + Unit = icon.unit,
502 + Value = icon.value,
503 + Variable = icon.variable,
528 506 local completion_kinds = vim.lsp.protocol.CompletionItemKind
529 507 for i, kind in ipairs( completion_kinds ) do
530 - completion_kinds[i] = completion_icons[kind] or kind
508 + completion_kinds[i] = completion_icons[kind] or kind
533 511 return setmetatable( _, {} )

neovim/lua/bugabinga/nugu/init.lua

Modified
46 46 local set_group_properties = function ( self, properties )
47 47 vim.validate {
48 - properties = { properties, 'table', },
48 + properties = { properties, 'table' },
49 49 -- • fg (or foreground): color name or "#RRGGBB", see note.
50 - ['properties.fg'] = { properties.fg, 'string', true, },
50 + ['properties.fg'] = { properties.fg, 'string', true },
51 51 -- • bg (or background): color name or "#RRGGBB", see note.
52 - ['properties.bg'] = { properties.bg, 'string', true, },
52 + ['properties.bg'] = { properties.bg, 'string', true },
53 53 -- • sp (or special): color name or "#RRGGBB"
54 - ['properties.sp'] = { properties.sp, 'string', true, },
54 + ['properties.sp'] = { properties.sp, 'string', true },
55 55 -- • blend: integer between 0 and 100
56 - ['properties.blend'] = { properties.blend, 'number', true, },
56 + ['properties.blend'] = { properties.blend, 'number', true },
57 57 -- • bold: boolean
58 - ['properties.bold'] = { properties.bold, 'boolean', true, },
58 + ['properties.bold'] = { properties.bold, 'boolean', true },
59 59 -- • standout: boolean
60 - ['properties.standout'] = { properties.standout, 'boolean', true, },
60 + ['properties.standout'] = { properties.standout, 'boolean', true },
61 61 -- • underline: boolean
62 - ['properties.underline'] = { properties.underline, 'boolean', true, },
62 + ['properties.underline'] = { properties.underline, 'boolean', true },
63 63 -- • undercurl: boolean
64 - ['properties.undercurl'] = { properties.undercurl, 'boolean', true, },
64 + ['properties.undercurl'] = { properties.undercurl, 'boolean', true },
65 65 -- • underdotted: boolean
66 - ['properties.underdotted'] = { properties.underdotted, 'boolean', true, },
66 + ['properties.underdotted'] = { properties.underdotted, 'boolean', true },
67 67 -- • underdashed: boolean
68 - ['properties.underdashed'] = { properties.underdashed, 'boolean', true, },
68 + ['properties.underdashed'] = { properties.underdashed, 'boolean', true },
69 69 -- • strikethrough: boolean
70 - ['properties.strikethrough'] = { properties.strikethrough, 'boolean', true, },
70 + ['properties.strikethrough'] = { properties.strikethrough, 'boolean', true },
71 71 -- • italic: boolean
72 - ['properties.italic'] = { properties.italic, 'boolean', true, },
72 + ['properties.italic'] = { properties.italic, 'boolean', true },
73 73 -- • reverse: boolean
74 - ['properties.reverse'] = { properties.reverse, 'boolean', true, },
74 + ['properties.reverse'] = { properties.reverse, 'boolean', true },
75 75 -- • nocombine: boolean
76 - ['properties.nocombine'] = { properties.nocombine, 'boolean', true, },
76 + ['properties.nocombine'] = { properties.nocombine, 'boolean', true },
77 77 -- • default: Don't override existing definition |:hi-default|
78 - ['properties.default'] = { properties.default, 'boolean', true, },
78 + ['properties.default'] = { properties.default, 'boolean', true },
79 79 -- • ctermfg: Sets foreground of cterm color |ctermfg|
80 - ['properties.ctermfg'] = { properties.ctermfg, 'string', true, },
80 + ['properties.ctermfg'] = { properties.ctermfg, 'string', true },
81 81 -- • ctermbg: Sets background of cterm color |ctermbg|
82 - ['properties.ctermbg'] = { properties.ctermbg, 'string', true, },
82 + ['properties.ctermbg'] = { properties.ctermbg, 'string', true },
83 83 -- • cterm: cterm attribute map, like |highlight-args|. If not set, cterm attributes will match those from the attribute map documented above.
84 - ['properties.cterm'] = { properties.cterm, 'table', true, },
84 + ['properties.cterm'] = { properties.cterm, 'table', true },
85 85 -- • force: if true force update the highlight group when it exists.
86 - ['properties.force'] = { properties.force, 'boolean', true, },
86 + ['properties.force'] = { properties.force, 'boolean', true },
88 88 -- vim.print( 'SET GROUP PROPERTIES', self, properties )
89 89 for key, value in pairs( properties ) do
119 -local _ = setmetatable( { groups = {}, }, {
119 +local _ = setmetatable( { groups = {} }, {
120 120 __index = add_group,
121 121 __newindex = link_group,
124 -_.Debug { fg = ui_normal, bg = debug, bold = true, }
124 +_.Debug { fg = ui_normal, bg = debug, bold = true }
126 -_.Normal { fg = content_normal, bg = content_backdrop, }
127 -_.Comment { fg = content_important_global, }
128 -_.NotifyBackground { bg = ui_backdrop, }
129 -_.LineNr { fg = ui_minor, bg = content_backdrop, }
130 -_.CursorLineNr { fg = ui_focus, bg = ui_backdrop, }
131 -_.Search { bg = content_unfocus, }
132 -_.IncSearch { fg = content_focus, }
133 -_.CurSearch { fg = content_important_global, bg = content_unfocus, }
134 -_.NormalFloat { fg = ui_normal, bg = ui_backdrop, }
135 -_.FloatBorder { fg = _.NormalFloat.bg, bg = _.NormalFloat.bg, }
136 -_.ColorColumn { fg = ui_important_global, bg = _.Normal.bg, }
137 -_.Conceal { fg = content_focus, bg = _.Normal.bg, }
138 -_.Cursor { bg = ui_accent, }
126 +_.Normal { fg = content_normal, bg = content_backdrop }
127 +_.Comment { fg = content_important_global }
128 +_.NotifyBackground { bg = ui_backdrop }
129 +_.LineNr { fg = ui_minor, bg = content_backdrop }
130 +_.CursorLineNr { fg = ui_focus, bg = ui_backdrop }
131 +_.Search { bg = content_unfocus }
132 +_.IncSearch { fg = content_focus }
133 +_.CurSearch { fg = content_important_global, bg = content_unfocus }
134 +_.NormalFloat { fg = ui_normal, bg = ui_backdrop }
135 +_.FloatBorder { fg = _.NormalFloat.bg, bg = _.NormalFloat.bg }
136 +_.ColorColumn { fg = ui_important_global, bg = _.Normal.bg }
137 +_.Conceal { fg = content_focus, bg = _.Normal.bg }
138 +_.Cursor { bg = ui_accent }
139 139 -- _.lCursor = _.Cursor
140 140 -- _.CursorIM = _.Cursor
141 -_.Directory { fg = _.Normal.fg, }
142 -_.DiffAdd { fg = content_focus, }
143 -_.DiffDelete { fg = content_focus, strikethrough = true, }
144 -_.DiffChange { fg = content_important_global, }
145 -_.DiffText { fg = content_normal, bg = content_unfocus, }
141 +_.Directory { fg = _.Normal.fg }
142 +_.DiffAdd { fg = content_focus }
143 +_.DiffDelete { fg = content_focus, strikethrough = true }
144 +_.DiffChange { fg = content_important_global }
145 +_.DiffText { fg = content_normal, bg = content_unfocus }
146 146 _.EndOfBuffer = _.Normal
147 147 -- _.TermCursor = _.Cursor
148 148 -- _.TermCursorNC = _.Cursor
149 -_.ErrorMsg { fg = error, }
150 -_.VertSplit { fg = ui_important_global, bg = _.LineNr.bg, }
149 +_.ErrorMsg { fg = error }
150 +_.VertSplit { fg = ui_important_global, bg = _.LineNr.bg }
151 151 _.Folded = _.Conceal
152 152 _.FoldColumn = _.LineNr
153 153 _.SignColumn = _.LineNr
154 -_.ModeMsg { bold = true, }
154 +_.ModeMsg { bold = true }
155 155 _.MsgArea = _.Normal
156 156 _.MsgSeparator = _.Debug
157 157 _.MoreMsg = _.Normal
158 -_.NonText { fg = content_unfocus, }
158 +_.NonText { fg = content_unfocus }
159 159 _.Whitespace = _.NonText
160 160 _.NormalNC = _.Normal
161 161 _.Pmenu = _.NormalFloat
162 -_.PmenuSel { fg = ui_important_local, sp = ui_important_local, bg = _.Pmenu.bg, bold = true, underline = true, }
163 -_.PmenuSbar { bg = ui_unfocus, }
164 -_.PmenuThumb { bg = ui_minor, }
165 -_.Question { fg = ui_important_local, bold = true, }
162 +_.PmenuSel { fg = ui_important_local, sp = ui_important_local, bg = _.Pmenu.bg, bold = true, underline = true }
163 +_.PmenuSbar { bg = ui_unfocus }
164 +_.PmenuThumb { bg = ui_minor }
165 +_.Question { fg = ui_important_local, bold = true }
166 166 _.QuickFixLine = _.PmenuSel
167 -_.SpecialKey { fg = error, bg = content_unfocus, bold = true, }
168 -_.SpellBad { fg = error, undercurl = true, }
167 +_.SpecialKey { fg = error, bg = content_unfocus, bold = true }
168 +_.SpellBad { fg = error, undercurl = true }
169 169 _.SpellCap = _.SpellBad
170 170 _.SpellLocal = _.SpellBad
171 171 _.SpellRare = _.SpellBad
172 -_.StatusLine { fg = ui_focus, bg = ui_unfocus, }
173 -_.StatusLineNC { fg = ui_normal, bg = ui_unfocus, }
174 -_.Winbar { fg = ui_focus, bg = _.StatusLine.bg, }
175 -_.WinbarNC { fg = ui_minor, bg = _.LineNr.bg, }
176 -_.Title { fg = content_important_global, sp = content_important_global, bold = true, underline = true, }
172 +_.StatusLine { fg = ui_focus, bg = ui_unfocus }
173 +_.StatusLineNC { fg = ui_normal, bg = ui_unfocus }
174 +_.Winbar { fg = ui_focus, bg = _.StatusLine.bg }
175 +_.WinbarNC { fg = ui_minor, bg = _.LineNr.bg }
176 +_.Title { fg = content_important_global, sp = content_important_global, bold = true, underline = true }
177 177 _.TabLine = _.StatusLine
178 -_.TabLineFill { fg = _.TabLine.fg, bg = content_backdrop, }
179 -_.TabLineSel { fg = ui_important_global, bg = ui_unfocus, }
180 -_.Visual { bg = content_unfocus, }
181 -_.VisualNOS { bg = ui_unfocus, }
182 -_.WarningMsg { fg = warning, bold = true, }
178 +_.TabLineFill { fg = _.TabLine.fg, bg = content_backdrop }
179 +_.TabLineSel { fg = ui_important_global, bg = ui_unfocus }
180 +_.Visual { bg = content_unfocus }
181 +_.VisualNOS { bg = ui_unfocus }
182 +_.WarningMsg { fg = warning, bold = true }
183 183 _.WildMenu = _.Debug
185 -_.String { fg = content_important_local, italic = true, }
185 +_.String { fg = content_important_local, italic = true }
186 186 _.Constant = _.String
187 187 _.Character = _.String
188 188 _.Number = _.String
193 193 _.MutableVariable = _.Debug
194 194 _.Function = _.Normal
196 -_.Statement { fg = content_minor, }
196 +_.Statement { fg = content_minor }
197 197 _.Conditional = _.Statement
198 198 _.Repeat = _.Statement
199 199 _.Label = _.Statement
200 200 _.Operator = _.Statement
201 201 _.Keyword = _.Statement
202 -_.Parameter { fg = content_focus, }
202 +_.Parameter { fg = content_focus }
203 203 _.Exception = _.Statement
205 -_.PreProc { fg = content_important_global, bg = content_unfocus, bold = true, }
205 +_.PreProc { fg = content_important_global, bg = content_unfocus, bold = true }
206 206 _.Include = _.PreProc
207 207 _.Define = _.PreProc
208 208 _.Macro = _.PreProc
213 213 _.Structure = _.Statement
214 214 _.Typedef = _.Statement
216 -_.Special { fg = content_normal, italic = true, bold = true, }
216 +_.Special { fg = content_normal, italic = true, bold = true }
217 217 _.SpecialChar = _.Special
218 218 _.Tag = _.Special
219 -_.Delimiter { fg = content_minor, }
219 +_.Delimiter { fg = content_minor }
220 220 _.SpecialComment = _.Special
222 -_.Underlined { sp = content_normal, underline = true, }
223 -_.Bold { bold = true, }
224 -_.Italic { italic = true, }
222 +_.Underlined { sp = content_normal, underline = true }
223 +_.Bold { bold = true }
224 +_.Italic { italic = true }
226 -_.Ignore { fg = _.Normal.bg, bg = _.Normal.bg, }
226 +_.Ignore { fg = _.Normal.bg, bg = _.Normal.bg }
228 -_.Error { fg = error, }
229 -_.Todo { fg = content_important_global, sp = content_important_global, bold = true, underdouble = true, }
230 -_.DiagnosticUnnecessary { fg = ui_focus, }
231 -_.DiagnosticDeprecated { fg = ui_important_global, sp = ui_important_global, strikethrough = true, }
232 -_.DiagnosticError { fg = error, }
233 -_.DiagnosticWarn { fg = warning, }
234 -_.DiagnosticInfo { fg = info, }
235 -_.DiagnosticHint { fg = ui_important_local, }
236 -_.DiagnosticOk { fg = ui_minor, }
228 +_.Error { fg = error }
229 +_.Todo { fg = content_important_global, sp = content_important_global, bold = true, underdouble = true }
230 +_.DiagnosticUnnecessary { fg = ui_focus }
231 +_.DiagnosticDeprecated { fg = ui_important_global, sp = ui_important_global, strikethrough = true }
232 +_.DiagnosticError { fg = error }
233 +_.DiagnosticWarn { fg = warning }
234 +_.DiagnosticInfo { fg = info }
235 +_.DiagnosticHint { fg = ui_important_local }
236 +_.DiagnosticOk { fg = ui_minor }
238 238 _.DiagnosticVirtualTextError = _.DiagnosticError
239 239 _.DiagnosticVirtualTextWarn = _.DiagnosticWarn
240 240 _.DiagnosticVirtualTextInfo = _.DiagnosticInfo
241 241 _.DiagnosticVirtualTextHint = _.DiagnosticHint
242 242 _.DiagnosticVirtualOkHint = _.DiagnosticOk
243 -_.DiagnosticUnderlineError { fg = _.DiagnosticError.fg, sp = _.DiagnosticError.fg, underdouble = true, }
244 -_.DiagnosticUnderlineWarn { fg = _.DiagnosticWarn.fg, sp = _.DiagnosticWarn.fg, underline = true, }
245 -_.DiagnosticUnderlineInfo { fg = _.DiagnosticInfo.fg, sp = _.DiagnosticInfo.fg, underdashed = true, }
246 -_.DiagnosticUnderlineHint { fg = _.DiagnosticHint.fg, sp = _.DiagnosticHint.fg, italic = true, underdotted = true, }
247 -_.DiagnosticUnderlineOk { fg = _.DiagnosticOk.fg, italic = true, }
243 +_.DiagnosticUnderlineError { fg = _.DiagnosticError.fg, sp = _.DiagnosticError.fg, underdouble = true }
244 +_.DiagnosticUnderlineWarn { fg = _.DiagnosticWarn.fg, sp = _.DiagnosticWarn.fg, underline = true }
245 +_.DiagnosticUnderlineInfo { fg = _.DiagnosticInfo.fg, sp = _.DiagnosticInfo.fg, underdashed = true }
246 +_.DiagnosticUnderlineHint { fg = _.DiagnosticHint.fg, sp = _.DiagnosticHint.fg, italic = true, underdotted = true }
247 +_.DiagnosticUnderlineOk { fg = _.DiagnosticOk.fg, italic = true }
248 248 _.DiagnosticSignError = _.DiagnosticError
249 249 _.DiagnosticSignWarn = _.DiagnosticWarn
250 250 _.DiagnosticSignInfo = _.DiagnosticInfo
251 251 _.DiagnosticSignHint = _.DiagnosticHint
252 252 _.DiagnosticSignOk = _.DiagnosticOk
254 -_.LspReferenceText { sp = content_unfocus, underline = true, }
254 +_.LspReferenceText { sp = content_unfocus, underline = true }
255 255 _.LspReferenceRead = _.LspReferenceText
256 256 _.LspReferenceWrite = _.LspReferenceText
257 -_.LspInlayHint { fg = content_minor, bg = _.Normal.bg, }
257 +_.LspInlayHint { fg = content_minor, bg = _.Normal.bg }
259 259 _['@text.literal'] = _.Comment
260 260 _['@text.reference'] = _.Identifier
290 290 _['@label'] = _.Label
291 291 _['@operator'] = _.Operator
292 292 _['@keyword'] = _.Keyword
293 -_['@keyword.return'] { fg = _.Keyword.fg, bg = _.Keyword.bg, underline = true, bold = true, }
293 +_['@keyword.return'] { fg = _.Keyword.fg, bg = _.Keyword.bg, underline = true, bold = true }
294 294 _['@exception'] = _.Exception
295 295 _['@variable'] = _.Identifier
296 296 _['@variable.parameter'] = _.Parameter
325 325 _['@lsp.type.decorator'] = _['@function']
327 327 _.LazyButton = _.NormalFloat
328 -_.LazyButton { sp = _.NormalFloat.fg, bold = true, }
329 -_.LazyButtonActive { fg = ui_focus, sp = _.NormalFloat.fg, bg = ui_important_local, bold = true, }
328 +_.LazyButton { sp = _.NormalFloat.fg, bold = true }
329 +_.LazyButtonActive { fg = ui_focus, sp = _.NormalFloat.fg, bg = ui_important_local, bold = true }
330 330 _.LazyComment = _.Keyword
331 331 _.LazyCommit = _.LazyComment
332 332 _.LazyCommitIssue = _.LazyComment
333 333 _.LazyCommitScope = _.LazyComment
334 -_.LazyCommitScope { italic = true, }
334 +_.LazyCommitScope { italic = true }
335 335 _.LazyCommitType = _.LazyCommitScope
336 -_.LazyDimmed { fg = _.NormalFloat.fg, }
337 -_.LazyDir { fg = _.NormalFloat.fg, }
336 +_.LazyDimmed { fg = _.NormalFloat.fg }
337 +_.LazyDir { fg = _.NormalFloat.fg }
338 338 _.LazyH1 = _.Bold
339 339 _.LazyH2 = _.LazyH1
340 340 _.LazyLocal {}
341 341 _.LazyNoCond = _.WarningMsg
342 342 _.LazyNormal = _.NormalFloat
343 -_.LazyProgressDone { fg = _.Search.bg, bg = _.Cursor.bg, bold = true, }
344 -_.LazyProgressTodo { fg = _.LazyProgressDone.bg, bg = _.LazyProgressDone.fg, bold = true, }
343 +_.LazyProgressDone { fg = _.Search.bg, bg = _.Cursor.bg, bold = true }
344 +_.LazyProgressTodo { fg = _.LazyProgressDone.bg, bg = _.LazyProgressDone.fg, bold = true }
345 345 _.LazyProp = _.LazyComment
346 346 _.LazyReasonCmd = _.NormalFloat
347 347 _.LazyReasonEvent = _.NormalFloat
352 352 _.LazyReasonRuntime = _.NormalFloat
353 353 _.LazyReasonSource = _.NormalFloat
354 354 _.LazyReasonStart = _.NormalFloat
355 -_.LazySpecial { fg = _.ColorColumn.fg, }
355 +_.LazySpecial { fg = _.ColorColumn.fg }
356 356 _.LazyTaskError = _.ErrorMsg
357 357 _.LazyTaskOutput = _.Debug
358 -_.LazyUrl { sp = _.NormalFloat.fg, italic = true, underline = true, }
359 -_.LazyValue { italic = true, }
361 --- _.NoiceCmdline = _.NormalFloat
362 --- _.NoiceCmdlineIcon { fg = ui_accent, }
363 --- _.NoiceCmdlineIconCalculator = _.NoiceCmdlineIcon
364 --- _.NoiceCmdlineIconCmdline = _.NoiceCmdlineIcon
365 --- _.NoiceCmdlineIconFilter = _.NoiceCmdlineIcon
366 --- _.NoiceCmdlineIconHelp = _.NoiceCmdlineIcon
367 --- _.NoiceCmdlineIconIncRename = _.NoiceCmdlineIcon
368 --- _.NoiceCmdlineIconInput = _.NoiceCmdlineIcon
369 --- _.NoiceCmdlineIconLua = _.NoiceCmdlineIcon
370 --- _.NoiceCmdlineIconSearch = _.NoiceCmdlineIcon
371 ---
372 --- _.NoiceCmdlinePopup = _.NormalFloat
373 --- _.NoiceCmdlinePopupBorder = _.FloatBorder
374 --- _.NoiceCmdlinePopupBorderCalculator = _.NoiceCmdlinePopupBorder
375 --- _.NoiceCmdlinePopupBorderCmdline = _.NoiceCmdlinePopupBorder
376 --- _.NoiceCmdlinePopupBorderFilter = _.NoiceCmdlinePopupBorder
377 --- _.NoiceCmdlinePopupBorderHelp = _.NoiceCmdlinePopupBorder
378 --- _.NoiceCmdlinePopupBorderIncRename = _.NoiceCmdlinePopupBorder
379 --- _.NoiceCmdlinePopupBorderInput = _.NoiceCmdlinePopupBorder
380 --- _.NoiceCmdlinePopupBorderLua = _.NoiceCmdlinePopupBorder
381 --- _.NoiceCmdlinePopupBorderSearch = _.NoiceCmdlinePopupBorder
382 --- _.NoiceCmdlinePopupTitle = _.NoiceCmdlinePopup
383 --- _.NoiceCmdlinePrompt = _.NoiceCmdlinePopup
384 --- _.NoiceCompletionItemKindDefault { fg = ui_normal, }
385 --- _.NoiceCompletionItemKindClass = _.NoiceCompletionItemKindDefault
386 --- _.NoiceCompletionItemKindColor = _.NoiceCompletionItemKindDefault
387 --- _.NoiceCompletionItemKindConstant = _.NoiceCompletionItemKindDefault
388 --- _.NoiceCompletionItemKindConstructor = _.NoiceCompletionItemKindDefault
389 --- _.NoiceCompletionItemKindEnum = _.NoiceCompletionItemKindDefault
390 --- _.NoiceCompletionItemKindEnumMember = _.NoiceCompletionItemKindDefault
391 --- _.NoiceCompletionItemKindField = _.NoiceCompletionItemKindDefault
392 --- _.NoiceCompletionItemKindFile = _.NoiceCompletionItemKindDefault
393 --- _.NoiceCompletionItemKindFolder = _.NoiceCompletionItemKindDefault
394 --- _.NoiceCompletionItemKindFunction = _.NoiceCompletionItemKindDefault
395 --- _.NoiceCompletionItemKindInterface = _.NoiceCompletionItemKindDefault
396 --- _.NoiceCompletionItemKindKeyword = _.NoiceCompletionItemKindDefault
397 --- _.NoiceCompletionItemKindMethod = _.NoiceCompletionItemKindDefault
398 --- _.NoiceCompletionItemKindModule = _.NoiceCompletionItemKindDefault
399 --- _.NoiceCompletionItemKindProperty = _.NoiceCompletionItemKindDefault
400 --- _.NoiceCompletionItemKindSnippet = _.NoiceCompletionItemKindDefault
401 --- _.NoiceCompletionItemKindStruct = _.NoiceCompletionItemKindDefault
402 --- _.NoiceCompletionItemKindText = _.NoiceCompletionItemKindDefault
403 --- _.NoiceCompletionItemKindUnit = _.NoiceCompletionItemKindDefault
404 --- _.NoiceCompletionItemKindValue = _.NoiceCompletionItemKindDefault
405 --- _.NoiceCompletionItemKindVariable = _.NoiceCompletionItemKindDefault
406 --- _.NoiceCompletionItemMenu = _.NoiceCompletionItemKindDefault
407 --- _.NoiceCompletionItemWord = _.NoiceCompletionItemKindDefault
408 ---
409 --- _.NoiceConfirm = _.NormalFloat
410 --- _.NoiceConfirmBorder = _.FloatBorder
411 --- _.NoiceFormatConfirm = _.LazyButton
412 --- _.NoiceFormatConfirmDefault = _.LazyButtonActive
413 ---
414 --- _.NoiceCursor = _.Cursor
415 ---
416 --- _.NoiceFormatDate = _.NonText
417 --- _.NoiceFormatEvent = _.NonText
418 --- _.NoiceFormatKind = _.NonText
419 --- _.NoiceFormatLevelDebug { fg = _.Debug.bg, }
420 --- _.NoiceFormatLevelError = _.DiagnosticError
421 --- _.NoiceFormatLevelInfo = _.DiagnosticInfo
422 --- _.NoiceFormatLevelOff { fg = content_minor, }
423 --- _.NoiceFormatLevelTrace = _.DiagnosticHint
424 --- _.NoiceFormatLevelWarn = _.DiagnosticWarn
425 --- _.NoiceFormatProgressDone = _.LazyProgressDone
426 --- _.NoiceFormatProgressTodo = _.LazyProgressTodo
427 --- _.NoiceFormatTitle = _.Title
428 ---
429 --- _.NoiceLspProgressClient = _.Debug
430 --- _.NoiceLspProgressSpinner = _.Debug
431 --- _.NoiceLspProgressTitle = _.Debug
432 ---
433 --- _.NoiceMini = _.DiagnosticInfo
434 ---
435 --- _.NoicePopup = _.NormalFloat
436 --- _.NoicePopupBorder = _.FloatBorder
437 ---
438 --- _.NoicePopupmenu = _.Pmenu
439 --- _.NoicePopupmenuBorder = _.FloatBorder
440 --- _.NoicePopupmenuMatch = _.Bold
441 --- _.NoicePopupmenuSelected = _.PmenuSel
442 ---
443 --- _.NoiceScrollbar = _.PmenuSbar
444 --- _.NoiceScrollbarThumb = _.PmenuThumb
445 ---
446 --- _.NoiceSplit = _.Normal
447 --- _.NoiceSplitBorder = _.FloatBorder
448 --- _.NoiceVirtualText { fg = ui_important_global, bg = ui_unfocus, }
449 --- _.NotifyERRORBorder { fg = _.DiagnosticError.fg, bg = _.FloatBorder.bg, }
450 --- _.NotifyWARNBorder { fg = _.DiagnosticWarn.fg, bg = _.FloatBorder.bg, }
451 --- _.NotifyINFOBorder { fg = _.DiagnosticInfo.fg, bg = _.FloatBorder.bg, }
452 --- _.NotifyDEBUGBorder { fg = _.Debug.bg, bg = _.FloatBorder.bg, }
453 --- _.NotifyTRACEBorder { fg = _.DiagnosticHint.fg, bg = _.FloatBorder.bg, }
454 ---
455 --- _.NotifyERRORIcon { fg = _.DiagnosticError.fg, }
456 --- _.NotifyWARNIcon { fg = _.DiagnosticWarn.fg, }
457 --- _.NotifyINFOIcon { fg = _.DiagnosticInfo.fg, }
458 --- _.NotifyDEBUGIcon { fg = _.Debug.bg, }
459 --- _.NotifyTRACEIcon { fg = _.DiagnosticHint.fg, }
460 ---
461 --- _.NotifyERRORTitle { fg = _.DiagnosticError.fg, }
462 --- _.NotifyWARNTitle { fg = _.DiagnosticWarn.fg, }
463 --- _.NotifyINFOTitle { fg = _.DiagnosticInfo.fg, }
464 --- _.NotifyDEBUGTitle { fg = _.Debug.bg, }
465 --- _.NotifyTRACETitle { fg = _.DiagnosticHint.fg, }
466 ---
467 --- _.NotifyERRORBody = _.NormalFloat
468 --- _.NotifyWARNBody = _.NormalFloat
469 --- _.NotifyINFOBody = _.NormalFloat
470 --- _.NotifyDEBUGBody = _.NormalFloat
471 --- _.NotifyTRACEBody = _.NormalFloat
358 +_.LazyUrl { sp = _.NormalFloat.fg, italic = true, underline = true }
359 +_.LazyValue { italic = true }
473 361 _.TelescopeSelectionCaret = _.PmenuSel
474 362 _.TelescopeSelection = _.PmenuSel
475 -_.TelescopeMultiSelection { fg = content_normal, bg = ui_important_local, }
363 +_.TelescopeMultiSelection { fg = content_normal, bg = ui_important_local }
477 -_.FlashBackdrop { fg = ui_normal, bg = ui_backdrop, }
365 +_.FlashBackdrop { fg = ui_normal, bg = ui_backdrop }
478 366 _.FlashMatch = _.IncSearch
479 367 _.FlashCurrent = _.CurSearch
480 -_.FlashLabel { fg = ui_accent, bg = ui_backdrop, }
368 +_.FlashLabel { fg = ui_accent, bg = ui_backdrop }
482 -_.GitSignsAdd { fg = _.DiffAdd.fg, bg = _.LineNr.bg, }
483 -_.GitSignsChange { fg = _.DiffChange.fg, bg = _.LineNr.bg, }
484 -_.GitSignsDelete { fg = _.DiffDelete.fg, bg = _.LineNr.bg, }
486 -_.GitSignsChangedelete = _.GitSignsChange
487 -_.GitSignsTopdelete = _.GitSignsDelete
488 -_.GitSignsUntracked = _.GitSignsAdd
490 -_.GitSignsAddNr = _.GitSignsAdd
491 -_.GitSignsChangeNr = _.GitSignsChange
492 -_.GitSignsDeleteNr = _.GitSignsDelete
494 -_.GitSignsChangedeleteNr = _.GitSignsChange
495 -_.GitSignsTopdeleteNr = _.GitSignsDelete
496 -_.GitSignsUntrackedNr = _.GitSignsAdd
498 -_.GitSignsAddLn = _.GitSignsAdd
499 -_.GitSignsChangeLn = _.GitSignsChange
500 -_.GitSignsChangedeleteLn = _.GitSignsChange
501 -_.GitSignsUntrackedLn = _.GitSignsAdd
503 -_.GitSignsAddPreview = _.GitSignsAdd
504 -_.GitSignsDeletePreview = _.GitSignsDelete
506 -_.GitSignsCurrentLineBlame = _.NonText
507 -_.GitSignsAddInline = _.GitSignsAdd
508 -_.GitSignsDeleteInline = _.GitSignsDelete
509 -_.GitSignsChangeInline = _.GitSignsChange
511 -_.GitSignsAddLnInline = _.DiffText
512 -_.GitSignsDeleteLnInline = _.DiffText
513 -_.GitSignsChangeLnInline = _.DiffText
515 -_.GitSignsDeleteVirtLn = _.GitSignsDelete
516 -_.GitSignsDeleteVirtLnInLine = _.DiffText
517 -_.GitSignsVirtLnum { fg = _.LineNr.fg, }
519 -_.WhichKey { fg = ui_important_global, }
520 -_.WhichKeyGroup { fg = ui_important_local, }
521 -_.WhichKeySeparator { fg = ui_minor, }
522 -_.WhichKeyDesc { fg = ui_normal, }
370 +_.WhichKey { fg = ui_important_global }
371 +_.WhichKeyGroup { fg = ui_important_local }
372 +_.WhichKeySeparator { fg = ui_minor }
373 +_.WhichKeyDesc { fg = ui_normal }
523 374 _.WhichKeyFloat = _.NormalFloat
524 375 _.WhichKeyBorder = _.FloatBorder
525 376 _.WhichKeyValue = _.Comment
527 378 _.IblIndent = _.Whitespace
528 379 _.IblWhitespace = _.Whitespace
529 -_.IblScope { fg = ui_focus, bg = _.Normal.bg, }
532 -_.MiniStarterCurrent { fg = ui_normal, bg = ui_accent, }
533 -_.MiniStarterFooter = _.Keyword
534 -_.MiniStarterHeader = _.Comment
535 -_.MiniStarterInactive { fg = content_unfocus, }
536 -_.MiniStarterItem = _.Normal
537 -_.MiniStarterItemBullet = _.Whitespace
538 -_.MiniStarterItemPrefix { fg = content_focus, }
539 -_.MiniStarterSection { fg = content_important_global, underline = true, }
540 -_.MiniStarterQuery { fg = content_normal, bg = content_accent, }
542 ---TODO: Oil highlights
380 +_.IblScope { fg = ui_focus, bg = _.Normal.bg }
544 382 return function ()
545 383 preview.setup()

neovim/lua/bugabinga/options/togglers.lua

Modified
33 33 display_name = display_name,
34 34 options = options,
35 35 toggle = toggle,
36 - tostring = toggler_tostring,
36 + tostring = toggler_tostring
43 43 return {
44 44 name = name,
45 45 default = option_value,
46 - alternative = alternative,
46 + alternative = alternative
51 51 table.insert( togglers, make_toggler( display_name, options ) )
54 -add_toggler( icon.spelling, { make_option 'spell', } )
55 -add_toggler( icon.linenumber, { make_option 'number', make_option 'relativenumber', } )
56 -add_toggler( icon.linehighlight, { make_option 'cursorline', } )
57 -add_toggler( icon.virtual, { make_option( 'virtualedit', 'all' ), } )
54 +add_toggler( icon.spelling, { make_option 'spell' } )
55 +add_toggler( icon.linenumber, { make_option 'number', make_option 'relativenumber' } )
56 +add_toggler( icon.linehighlight, { make_option 'cursorline' } )
57 +add_toggler( icon.wrap, { make_option 'wrap' } )
58 +add_toggler( icon.virtual, { make_option( 'virtualedit', 'all' ) } )
59 60 local tostring = function ( self )
60 61 return vim.iter( self )
67 68 return setmetatable( togglers, {
68 - __tostring = tostring,
69 + __tostring = tostring

neovim/lua/bugabinga/plugins/comment.lua

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

neovim/lua/bugabinga/plugins/commentstring.lua

Deleted
deleted file mode 100644
1 -return {
2 - 'JoosepAlviste/nvim-ts-context-commentstring',
3 - init = function ()
4 - vim.g.skip_ts_context_commentstring_module = true
5 - end,
6 - opts = { enable_autocmd = false, },
7 -}

neovim/lua/bugabinga/plugins/flash.lua

Modified
4 4 local map = require 'std.map'
6 6 map.normal.visual.operator_pending {
7 7 keys = '<cr>',
8 8 category = 'navigation',
9 9 description = 'Jump to occurence of next chars quickly',
10 - command = function () require 'flash'.jump() end,
10 + command = function () prequire 'flash'.jump() end,
13 +map.normal.visual.operator_pending {
14 + keys = '<s-cr>',
15 + category = 'navigation',
16 + description = 'Jump to occurence of next treesitter node quickly',
17 + command = function () prequire 'flash'.treesitter() end,
19 +-- { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
20 +-- { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
21 +-- { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
22 +-- { "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
13 24 return {
14 25 'folke/flash.nvim',
15 - version = '1.*',
16 - -- event = 'VeryLazy',
26 + version = '2.*',
27 + event = 'VeryLazy',
17 28 opts = {
18 - -- highlight = { backdrop = false, },
19 - -- modes = { char = { highlight = { backdrop = false, }, }, },
29 + highlight = { backdrop = false },
30 + modes = { char = { highlight = { backdrop = false } } },

neovim/lua/bugabinga/plugins/glow.lua

Deleted
deleted file mode 100644
1 -require 'bugabinga.health'.add_dependency
2 -{
3 - name = 'Glow',
4 - name_of_executable = 'glow',
5 -}
7 -local map = require 'std.map'
9 -map.normal {
10 - description = 'Generate markdown preview',
11 - keys = '<leader>gm',
12 - category = 'preview',
13 - command = '<cmd>Glow<cr>',
14 -}
16 -return {
17 - 'ellisonleao/glow.nvim',
18 - cmd = 'Glow',
19 - opts = {
20 - width_ratio = 0.69,
21 - height_ratio = 0.42,
22 - },
23 -}

neovim/lua/bugabinga/plugins/heirline.lua

Modified
10 10 'rebelot/heirline.nvim',
11 11 version = '1.*',
12 - event = 'VeryLazy',
12 + lazy = false,
13 13 dependencies = {
14 + -- FIXME: use my own icons
14 15 'nvim-tree/nvim-web-devicons',
15 - { 'echasnovski/mini.diff', lazy = true, },
16 - { 'SmiteshP/nvim-navic', lazy = true, },
17 - {
18 - 'linrongbin16/lsp-progress.nvim',
19 - config = true,
20 - lazy = false,
21 - },
23 17 config = function ()
24 18 local heirline = require 'heirline'
103 97 hl = function ( self )
104 98 local mode = self.mode:sub( 1, 1 ) -- get only the first mode character
105 - return { fg = self.mode_colors[mode], bold = true, }
99 + return { fg = self.mode_colors[mode], bold = true }
108 102 update = {
118 112 init = function ( self )
119 113 local filename = self.filename
120 114 local extension = vim.fn.fnamemodify( filename, ':e' )
121 - self.icon = require 'nvim-web-devicons'.get_icon_color( filename, extension, { default = true, } )
115 + self.icon = require 'nvim-web-devicons'.get_icon_color( filename, extension, { default = true } )
123 117 provider = function ( self )
124 118 return self.icon and (self.icon .. ' ')
173 167 file_icon,
174 - { provider = ' ', },
168 + { provider = ' ' },
175 169 file_name,
176 170 file_flags,
177 - { provider = '%<', }, -- this means that the statusline is cut here when there's not enough space
171 + { provider = '%<' }, -- this means that the statusline is cut here when there's not enough space
180 174 local file_type = {
206 200 provider = function ()
207 201 -- stackoverflow, compute human readable file size
208 202 -- i want to see vim opening a 1EiB file 󰱯
209 - local suffix = { 'b', 'k', 'M', 'G', 'T', 'P', 'E', }
203 + local suffix = { 'b', 'k', 'M', 'G', 'T', 'P', 'E' }
210 204 local fsize = vim.fn.getfsize( vim.api.nvim_buf_get_name( 0 ) )
211 205 fsize = (fsize < 0 and 0) or fsize
212 206 if fsize < 1024 then
231 225 condition = conditions.lsp_attached,
232 226 -- FIXME: updates from parent components do not seem to update children,
233 227 -- if those have their own updates?
234 - update = { 'LspAttach', 'LspDetach', 'BufEnter', 'BufLeave', },
228 + update = { 'LspAttach', 'LspDetach', 'BufEnter', 'BufLeave' },
236 230 provider = function ()
237 231 local names = {}
238 - for _, client in pairs( vim.lsp.get_clients { bufnr = 0, } ) do
232 + for _, client in pairs( vim.lsp.get_clients { bufnr = 0 } ) do
239 233 table.insert( names, client.name )
241 235 return icon.lsp .. ' ' .. table.concat( names, ' ' )
245 - local lsp_progress = {
246 - provider = function ()
247 - return require 'lsp-progress'.progress()
248 - end,
249 - update = {
250 - 'User',
251 - pattern = 'LspProgressStatusUpdated',
252 - callback = vim.schedule_wrap( function ()
253 - vim.cmd 'redrawstatus'
254 - end ),
255 - },
256 - }
258 - local navic = {
259 - condition = function ()
260 - local ok, navic = pcall( require, 'nvim-navic' )
261 - return ok and navic.is_available()
262 - end,
263 - static = {
264 - -- create a type highlight map
265 - type_hl = {
266 - File = 'Directory',
267 - Module = '@include',
268 - Namespace = '@namespace',
269 - Package = '@include',
270 - Class = '@structure',
271 - Method = '@method',
272 - Property = '@property',
273 - Field = '@field',
274 - Constructor = '@constructor',
275 - Enum = '@field',
276 - Interface = '@type',
277 - Function = '@function',
278 - Variable = '@variable',
279 - Constant = '@constant',
280 - String = '@string',
281 - Number = '@number',
282 - Boolean = '@boolean',
283 - Array = '@field',
284 - Object = '@type',
285 - Key = '@keyword',
286 - Null = '@comment',
287 - EnumMember = '@field',
288 - Struct = '@structure',
289 - Event = '@keyword',
290 - Operator = '@operator',
291 - TypeParameter = '@type',
292 - },
293 - -- bit operation dark magic, see below...
294 - enc = function ( line, col, winnr )
295 - return bit.bor( bit.lshift( line, 16 ), bit.lshift( col, 6 ), winnr )
296 - end,
297 - -- line: 16 bit (65535); col: 10 bit (1023); winnr: 6 bit (63)
298 - dec = function ( c )
299 - local line = bit.rshift( c, 16 )
300 - local col = bit.band( bit.rshift( c, 6 ), 1023 )
301 - local winnr = bit.band( c, 63 )
302 - return line, col, winnr
303 - end,
304 - },
305 - init = function ( self )
306 - local data = require 'nvim-navic'.get_data() or {}
307 - local children = {}
308 - -- create a child for each level
309 - for i, d in ipairs( data ) do
310 - -- encode line and column numbers into a single integer
311 - local pos = self.enc( d.scope.start.line, d.scope.start.character, self.winnr )
312 - local child = {
313 - {
314 - provider = d.icon,
315 - hl = self.type_hl[d.type],
316 - },
317 - {
318 - -- escape `%`s (elixir) and buggy default separators
319 - provider = d.name:gsub( '%%', '%%%%' ):gsub( '%s*->%s*', '' ),
320 - -- highlight icon only or location name as well
321 - hl = self.type_hl[d.type],
323 - on_click = {
324 - -- pass the encoded position through minwid
325 - minwid = pos,
326 - callback = function ( _, minwid )
327 - -- decode
328 - local line, col, winnr = self.dec( minwid )
329 - vim.api.nvim_win_set_cursor( vim.fn.win_getid( winnr ), { line, col, } )
330 - end,
331 - name = 'heirline_navic',
332 - },
333 - },
334 - }
335 - -- add a separator only if needed
336 - if #data > 1 and i < #data then
337 - table.insert( child, {
338 - provider = ' > ',
339 - -- hl = { fg = 'bright_fg', },
340 - } )
341 - end
342 - table.insert( children, child )
343 - end
344 - -- instantiate the new child, overwriting the previous one
345 - self.child = self:new( children, 1 )
346 - end,
347 - -- evaluate the children containing navic components
348 - provider = function ( self )
349 - return self.child:eval()
350 - end,
351 - -- hl = { fg = 'gray', },
352 - update = 'CursorMoved',
353 - }
355 239 local diagnostic = {
356 240 condition = conditions.has_diagnostics,
365 249 init = function ( self )
366 - self.errors = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.ERROR, } )
367 - self.warnings = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.WARN, } )
368 - self.hints = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.HINT, } )
369 - self.info = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.INFO, } )
250 + self.errors = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.ERROR } )
251 + self.warnings = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.WARN } )
252 + self.hints = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.HINT } )
253 + self.info = #vim.diagnostic.get( 0, { severity = vim.diagnostic.severity.INFO } )
372 - update = { 'DiagnosticChanged', 'BufEnter', 'BufLeave', },
256 + update = { 'DiagnosticChanged', 'BufEnter', 'BufLeave' },
375 259 provider = function ( self )
412 296 local svn_get_relative_url = function ()
413 297 -- FIXME: replace with vim.system
414 298 local job = require 'plenary.job'
415 - local relative_url = { '[ERR]', }
299 + local relative_url = { '[ERR]' }
418 302 :new {
419 303 command = 'svn',
420 - args = { 'info', '--show-item', 'relative-url', '--no-newline', },
304 + args = { 'info', '--show-item', 'relative-url', '--no-newline' },
421 305 on_exit = function ( current_job, exit_code )
422 306 if exit_code == 0 then
423 307 relative_url = current_job:result()
531 415 provider = icon.macro .. ' ',
532 416 hl = 'PreProc',
533 - utils.surround( { '░▒▓ ', ' ▓▒░', }, nil, {
417 + utils.surround( { '░▒▓ ', ' ▓▒░' }, nil, {
534 418 provider = function ()
535 419 return vim.fn.reg_recording()
547 431 local ok, lazy_status = pcall( require, 'lazy.status' )
548 432 return ok and lazy_status.has_updates()
550 - update = { 'User', pattern = 'LazyUpdate', },
434 + update = { 'User', pattern = 'LazyUpdate' },
551 435 provider = function ()
552 436 return ' ' .. icon.lazy .. ' ' .. require 'lazy.status'.updates() .. ' '
562 - local align = { provider = '%=', }
563 - local space = { provider = ' ', }
446 + local align = { provider = '%=' }
447 + local space = { provider = ' ' }
565 449 local default_statusline = {
566 450 vi_mode,
578 462 space,
579 463 lsp_active,
580 464 space,
581 - lsp_progress,
582 - space,
583 465 file_encoding,
584 466 space,
585 467 file_format,
608 490 local terminal_statusline = {
610 492 condition = function ()
611 - return conditions.buffer_matches { buftype = { 'terminal', }, }
493 + return conditions.buffer_matches { buftype = { 'terminal' } }
614 - { condition = conditions.is_active, vi_mode, space, },
496 + { condition = conditions.is_active, vi_mode, space },
615 497 file_type,
616 498 space,
617 499 terminal_name,
658 540 condition = function ()
659 - return conditions.buffer_matches { buftype = { 'terminal', }, }
541 + return conditions.buffer_matches { buftype = { 'terminal' } }
662 544 file_type,
668 550 file_name_block,
669 - space,
670 - navic,
789 669 local tab_pages = {
790 - { provider = '%=', },
670 + { provider = '%=' },
791 671 utils.make_tablist( tabpage ),

neovim/lua/bugabinga/plugins/lint.lua

Modified
1 1 --FIXME: own this
2 -local uv = vim.uv or vim.loop
3 2 return {
4 3 'mfussenegger/nvim-lint',
5 4 ft = {
6 5 'lua',
7 6 'sh',
8 - 'nu',
7 + 'systemd',
8 + 'editorconfig',
9 + 'yaml',
10 11 opts = {
11 12 linters_by_ft = {
12 - lua = { 'selene', },
13 - sh = { 'shellcheck', 'dotenv_linter', },
14 - systemd = { 'systemd-analyze', },
13 + lua = { 'selene' },
14 + sh = { 'shellcheck', 'dotenv_linter' },
15 + systemd = { 'systemd-analyze' },
16 + editorconfig = { 'editorconfig-checker' },
17 + yaml = { 'yq' },
16 - linters = { },
19 + linters = {},
18 21 config = function ( _, opts )
19 22 local lint = require 'lint'
21 24 for k, v in pairs( opts.linters ) do
22 25 lint.linters[k] = v
24 - local timer = assert( uv.new_timer() )
27 + ---@diagnostic disable-next-line: undefined-field
28 + local timer = assert( vim.uv.new_timer() )
25 29 local DEBOUNCE_MS = 500
26 - local aug = vim.api.nvim_create_augroup( 'Lint', { clear = true, } )
27 - vim.api.nvim_create_autocmd( { 'BufWritePost', }, {
30 + local aug = vim.api.nvim_create_augroup( 'Lint', { clear = true } )
31 + vim.api.nvim_create_autocmd( { 'BufWritePost' }, {
28 32 group = aug,
29 33 callback = function ()
30 34 local bufnr = vim.api.nvim_get_current_buf()
32 36 timer:start( DEBOUNCE_MS, 0,
33 37 vim.schedule_wrap( function ()
34 38 if vim.api.nvim_buf_is_valid( bufnr ) then
35 - vim.api.nvim_buf_call( bufnr, function () lint.try_lint( nil, { ignore_errors = true, } ) end )
39 + vim.api.nvim_buf_call( bufnr, function () lint.try_lint( nil, { ignore_errors = true } ) end )
37 41 end )

neovim/lua/bugabinga/plugins/navbuddy.lua

Deleted
deleted file mode 100644
1 -local map = require 'std.map'
3 -return {
4 - 'SmiteshP/nvim-navbuddy',
5 - dependencies = {
6 - 'SmiteshP/nvim-navic',
7 - 'MunifTanjim/nui.nvim',
8 - },
9 - opts = {
10 - window = {
11 - border = vim.g.border_style,
12 - },
13 - },
14 -}

neovim/lua/bugabinga/plugins/navic.lua

Deleted
deleted file mode 100644
1 -return { 'SmiteshP/nvim-navic', opts = {}, }

neovim/lua/bugabinga/plugins/neogen.lua

Deleted
deleted file mode 100644
1 -local map = require 'std.map'
3 -map.normal {
4 - description = 'Doc Comment',
5 - category = 'generate',
6 - keys = '<leader>gdd',
7 - command = function () require 'neogen'.generate() end,
8 -}
10 -map.normal {
11 - name = 'Doc Comment for Function',
12 - category = 'generate',
13 - keys = '<leader>gdm',
14 - command = function () require 'neogen'.generate { type = 'func', } end,
15 -}
17 -map.normal {
18 - description = 'Doc Comment for File',
19 - category = 'generate',
20 - keys = '<leader>gdf',
21 - command = function () require 'neogen'.generate { type = 'file', } end,
22 -}
24 -map.normal {
25 - description = 'Doc Comment for Class',
26 - category = 'generate',
27 - keys = '<leader>gdc',
28 - command = function () require 'neogen'.generate { type = 'class', } end,
29 -}
31 -map.normal {
32 - description = 'Doc Comment for Type',
33 - category = 'generate',
34 - keys = '<leader>gdt',
35 - command = function () require 'neogen'.generate { type = 'type', } end,
36 -}
38 -return {
39 - 'danymat/neogen',
40 - dependencies = { 'nvim-treesitter/nvim-treesitter', },
41 - opts = {
42 - snippet_engine = 'luasnip',
43 - },
44 -}

neovim/lua/bugabinga/plugins/nrpattern.lua

Deleted
deleted file mode 100644
1 -return {
2 - 'zegervdv/nrpattern.nvim',
3 - keys = { '<C-a>', '<C-x>', },
4 - config = function ()
5 - local nrpattern = require 'nrpattern'
6 - -- this plugin overrides all its settings if empty map is given
7 - nrpattern.setup()
8 - end,
9 -}

neovim/lua/bugabinga/plugins/nui.lua

Modified
1 -return { 'MunifTanjim/nui.nvim', }
1 +return {
2 + 'MunifTanjim/nui.nvim',
3 +}

neovim/lua/bugabinga/plugins/qf_helper.lua

Deleted
deleted file mode 100644
1 -local map = require 'std.map'
3 -map.normal {
4 - description = 'Grep search for word under cursor',
5 - category = 'search',
6 - keys = 'gw',
7 - command = '<cmd>cclose <bar> Grep <cword><cr>',
8 -}
10 -map.normal {
11 - description = 'Goto next quickfix item',
12 - category = 'navigation',
13 - keys = ']q',
14 - command = '<cmd>QNext<cr>',
15 -}
17 -map.normal {
18 - description = 'Goto previous quickfix item',
19 - category = 'navigation',
20 - keys = '[q',
21 - command = '<cmd>QPrev<cr>',
22 -}
24 -map.normal {
25 - description = 'Toggle open quickfix window',
26 - category = 'navigation',
27 - keys = '<leader>Q',
28 - command = '<cmd>QFToggle!<CR>',
29 -}
31 -map.normal {
32 - description = 'Toggle open loclist window',
33 - category = 'navigation',
34 - keys = '<leader>L',
35 - command = '<cmd>LLToggle!<CR>',
36 -}
38 -return {
39 - 'stevearc/qf_helper.nvim',
40 - ft = 'qf',
41 - cmd = { 'QNext', 'QPrev', 'QFToggle', 'QFOpen', 'LLToggle', },
42 - opts = {
43 - prefer_loclist = false,
44 - },
45 -}

neovim/lua/bugabinga/plugins/schemastore.lua

Deleted
deleted file mode 100644
1 -return { 'b0o/schemastore.nvim', }

neovim/lua/bugabinga/plugins/ssr.lua

Deleted
deleted file mode 100644
1 -local map = require 'std.map'
2 -local user_command = require 'std.user_command'
4 -local open_ssr = function () prequire 'ssr'.open() end
6 -map.normal.visual {
7 - description = 'Open structural search and replace',
8 - category = 'refactoring',
9 - keys = '<leader>rr',
10 - command = open_ssr,
11 -}
13 -user_command.StructuralSearchAndReplace
14 -'Open structural search and replace view' (
15 - open_ssr
16 - )
18 -return {
19 - 'cshuaimin/ssr.nvim',
20 - opts = {
21 - border = vim.g.border_style,
22 - min_width = 69,
23 - min_height = 42,
24 - max_width = 3 * 69,
25 - max_height = 3 * 42,
26 - adjust_window = true,
27 - keymaps = {
28 - close = 'q',
29 - next_match = 'n',
30 - prev_match = 'N',
31 - replace_confirm = '<cr>',
32 - replace_all = '<c-cr>',
33 - },
34 - },
35 -}

neovim/lua/bugabinga/plugins/transparent.lua

Deleted
deleted file mode 100644
1 -local map = require 'std.map'
3 -map.normal {
4 - description = 'Toggle background transparency.',
5 - category = 'ui',
6 - keys = '<leader>tb',
7 - command = '<cmd>TransparentToggle<cr>',
8 -}
10 -return {
11 - 'xiyaowong/transparent.nvim',
12 - cmd = { 'TransparentEnable', 'TransparentDisable', 'TransparentToggle', },
13 - config = true,
14 -}

neovim/lua/bugabinga/plugins/treesitter.lua

Modified
1 1 require 'bugabinga.health'.add_dependency
2 -{ name = 'CMake', name_of_executable = 'cmake', }
3 - { name_of_executable = 'make', }
4 - { name_of_executable = 'zig', }
5 - { name = 'TreeSitter CLI', name_of_executable = 'tree-sitter', }
6 - { name_of_executable = 'tar', }
2 +{ name = 'CMake', name_of_executable = 'cmake' }
3 + { name_of_executable = 'make' }
4 + { name_of_executable = 'zig' }
5 + { name = 'TreeSitter CLI', name_of_executable = 'tree-sitter' }
6 + { name_of_executable = 'tar' }
8 8 return {
9 9 'nvim-treesitter/nvim-treesitter',
10 - -- version = '0.9.*',
11 - -- branch = 'main', -- next gen version
12 10 branch = 'master',
13 11 lazy = false,
14 12 build = function ()
15 - require 'nvim-treesitter.install'.update { with_sync = true, }
13 + require 'nvim-treesitter.install'.update { with_sync = true }
17 15 dependencies = {
18 - -- 'nvim-treesitter/playground',
16 + -- FIXME: move nvim-treesitter modules out into normal config to prepare for main branch
19 17 'nvim-treesitter/nvim-treesitter-textobjects',
20 18 'windwp/nvim-ts-autotag',
21 19 'RRethy/nvim-treesitter-endwise',
22 - 'nvim-treesitter/nvim-treesitter-context',
23 20 'nushell/tree-sitter-nu',
25 22 config = function ()
27 24 local configs = require 'nvim-treesitter.configs'
29 26 install.prefer_git = false
30 - install.compilers = { 'zig cc', 'clang', 'gcc', 'cl', 'cc', vim.fn.getenv 'CC', }
27 + install.compilers = { 'zig cc', 'clang', 'gcc', 'cl', 'cc', vim.fn.getenv 'CC' }
32 29 local should_disable = function ( _, bufnr )
33 30 local max_filesize = 5 * 1024 * 1024 --MiB
31 + ---@diagnostic disable-next-line: undefined-field
34 32 local ok, stats = pcall( vim.loop.fs_stat, vim.api.nvim_buf_get_name( bufnr or 0 ) )
35 33 if ok and stats and stats.size > max_filesize then
36 34 return true
41 39 ---@diagnostic disable-next-line: missing-fields
42 40 configs.setup {
43 41 sync_install = false,
44 - ignore_install = { 'oil', },
42 + ignore_install = { 'oil' },
45 43 auto_install = true,
47 - autotag = { enable = true, disable = should_disable, },
48 - endwise = { enable = true, disable = should_disable, },
45 + autotag = { enable = true, disable = should_disable },
46 + endwise = { enable = true, disable = should_disable },
50 48 highlight = {
51 49 enable = true,
57 55 enable = true,
58 56 disable = should_disable,
59 57 keymaps = {
58 + -- FIXME: not too happy with these binds. but i dont feel better ones right now.
60 59 init_selection = '<up>',
61 60 node_incremental = '<up>',
62 61 node_decremental = '<down>',
67 - indent = { enable = true, disable = should_disable, },
66 + indent = { enable = true, disable = should_disable },
69 68 textobjects = {
70 69 select = {
72 71 disable = should_disable,
73 72 lookahead = true,
74 73 keymaps = {
75 - ['af'] = { query = '@call.outer', desc = 'outer function call', },
76 - ['if'] = { query = '@call.inner', desc = 'inner function call', },
74 + ['af'] = { query = '@call.outer', desc = 'outer function call' },
75 + ['if'] = { query = '@call.inner', desc = 'inner function call' },
78 - ['am'] = { query = '@function.outer', desc = 'outer function definition', },
79 - ['im'] = { query = '@function.inner', desc = 'inner function definition', },
77 + ['am'] = { query = '@function.outer', desc = 'outer function definition' },
78 + ['im'] = { query = '@function.inner', desc = 'inner function definition' },
81 - ['ac'] = { query = '@class.outer', desc = 'outer class', },
82 - ['ic'] = { query = '@class.inner', desc = 'inner class', },
80 + ['ai'] = { query = '@conditional.outer', desc = 'outer conditional' },
81 + ['ii'] = { query = '@conditional.inner', desc = 'inner conditional' },
84 - ['ai'] = { query = '@conditional.outer', desc = 'outer conditional', },
85 - ['ii'] = { query = '@conditional.inner', desc = 'inner conditional', },
83 + ['aa'] = { query = '@parameter.outer', desc = 'outer parameter' },
84 + ['ia'] = { query = '@parameter.inner', desc = 'inner parameter' },
87 - ['al'] = { query = '@loop.outer', desc = 'outer loop', },
88 - ['il'] = { query = '@loop.inner', desc = 'inner loop', },
90 - ['aa'] = { query = '@parameter.outer', desc = 'outer parameter', },
91 - ['ia'] = { query = '@parameter.inner', desc = 'inner parameter', },
93 - ['agc'] = { query = '@comment.outer', desc = 'outer comment', },
94 - ['igc'] = { query = '@comment.inner', desc = 'inner comment', },
86 + ['ac'] = { query = '@comment.outer', desc = 'outer comment' },
87 + ['ic'] = { query = '@comment.inner', desc = 'inner comment' },
96 89 selection_modes = {
97 90 ['@parameter.outer'] = 'v',
107 100 disable = should_disable,
108 101 set_jumps = true,
109 102 goto_next = {
110 - [']f'] = { query = '@call.outer', desc = 'Goto next function call', },
111 - [']m'] = { query = '@function.outer', desc = 'Goto next function definition', },
112 - [']c'] = { query = '@class.outer', desc = 'Goto next class', },
113 - [']o'] = { query = '@conditional.outer', desc = 'Goto next conditional', },
114 - [']p'] = { query = '@parameter.outer', desc = 'Goto next parameter', },
103 + [']m'] = { query = '@function.outer', desc = 'Goto next function definition' },
116 105 goto_previous = {
117 - ['[f'] = { query = '@call.outer', desc = 'Goto previous function call', },
118 - ['[m'] = { query = '@function.outer', desc = 'Goto previous function definition', },
119 - ['[c'] = { query = '@class.outer', desc = 'goto previous class', },
120 - ['[o'] = { query = '@conditional.outer', desc = 'Goto previous conditional', },
121 - ['[p'] = { query = '@parameter.outer', desc = 'Goto previous parameter', },
106 + ['[m'] = { query = '@function.outer', desc = 'Goto previous function definition' },
127 - require 'treesitter-context'.setup {
128 - enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
129 - disable = should_disable,
130 - max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
131 - min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
132 - line_numbers = true,
133 - multiline_threshold = 10, -- Maximum number of lines to show for a single context
134 - trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
135 - mode = 'topline', -- Line used to calculate context. Choices: 'cursor', 'topline'
136 - -- Separator between context and content. Should be a single character string, like '-'.
137 - -- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
138 - separator = '-',
139 - zindex = 20, -- The Z-index of the context window
140 - on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching
141 - }

neovim/lua/bugabinga/plugins/zen.lua

Modified
10 10 return {
11 11 'folke/zen-mode.nvim',
12 12 cmd = 'ZenMode',
13 - dependencies = { { 'folke/twilight.nvim', opts = { dimming = { inactive = true, }, }, }, },
13 + dependencies = { { 'folke/twilight.nvim', opts = { dimming = { inactive = false, }, }, }, },
14 14 opts = {
15 - --FIXME: this does not work, because on win32 there is no base64 binary
16 - plugins = { wezterm = { enabled = true, font = '+4', }, },
15 + plugins = { wezterm = { enabled = true, font = '+2', }, },
17 16 window = {
18 17 width = 0.69,
19 18 backdrop = 0.42,

neovim/lua/std/defer.lua

Modified
3 3 -- taken from https://gist.github.com/runiq/31aa5c4bf00f8e0843cd267880117201
5 5 local _ = {}
7 7 ---Validates args for `throttle()` and `debounce()`.
8 -local function td_validate(fn, ms)
9 - vim.validate{
10 - fn = { fn, 'f' },
11 - ms = {
12 - ms,
13 - function(ms)
14 - return type(ms) == 'number' and ms > 0
15 - end,
16 - "number > 0",
17 - },
18 - }
8 +local function td_validate( fn, ms )
9 + vim.validate {
10 + fn = { fn, 'f' },
11 + ms = {
12 + ms,
13 + function ( ms )
14 + return type( ms ) == 'number' and ms > 0
15 + end,
16 + 'number > 0',
17 + },
18 + }
21 21 --- Throttles a function on the leading edge. Automatically `schedule_wrap()`s.
22 22 --@param timeout (number) Timeout in ms
23 23 --@returns (function, timer) throttled function and timer. Remember to call
24 24 ---`timer:close()` at the end or you will leak memory!
25 -function _.throttle_leading(fn, ms)
26 - td_validate(fn, ms)
27 - local timer = vim.loop.new_timer()
28 - local running = false
25 +function _.throttle_leading( fn, ms )
26 + td_validate( fn, ms )
27 + local timer = vim.loop.new_timer()
28 + local running = false
30 - local function wrapped_fn(...)
31 - if not running then
32 - timer:start(ms, 0, function()
33 - running = false
34 - end)
35 - running = true
36 - pcall(vim.schedule_wrap(fn), select(1, ...))
37 - end
38 - end
39 - return wrapped_fn, timer
30 + local function wrapped_fn( ... )
31 + if not running then
32 + timer:start( ms, 0, function ()
33 + running = false
34 + end )
35 + running = true
36 + pcall( vim.schedule_wrap( fn ), select( 1, ... ) )
37 + end
38 + end
39 + return wrapped_fn, timer
42 42 --- Throttles a function on the trailing edge. Automatically
48 48 ---call to `fn` within the timeframe. Default: Use arguments of the first call.
49 49 --@returns (function, timer) Throttled function and timer. Remember to call
50 50 ---`timer:close()` at the end or you will leak memory!
51 -function _.throttle_trailing(fn, ms, last)
52 - td_validate(fn, ms)
53 - local timer = vim.loop.new_timer()
54 - local running = false
51 +function _.throttle_trailing( fn, ms, last )
52 + td_validate( fn, ms )
53 + local timer = vim.loop.new_timer()
54 + local running = false
56 - local wrapped_fn
57 - if not last then
58 - function wrapped_fn(...)
59 - if not running then
60 - local argv = {...}
61 - local argc = select('#', ...)
56 + local wrapped_fn
57 + if not last then
58 + function wrapped_fn( ... )
59 + if not running then
60 + local argv = { ... }
61 + local argc = select( '#', ... )
63 - timer:start(ms, 0, function()
64 - running = false
65 - pcall(vim.schedule_wrap(fn), unpack(argv, 1, argc))
66 - end)
67 - running = true
68 - end
69 - end
70 - else
71 - local argv, argc
72 - function wrapped_fn(...)
73 - argv = {...}
74 - argc = select('#', ...)
63 + timer:start( ms, 0, function ()
64 + running = false
65 + pcall( vim.schedule_wrap( fn ), unpack( argv, 1, argc ) )
66 + end )
67 + running = true
68 + end
69 + end
70 + else
71 + local argv, argc
72 + function wrapped_fn( ... )
73 + argv = { ... }
74 + argc = select( '#', ... )
76 - if not running then
77 - timer:start(ms, 0, function()
78 - running = false
79 - pcall(vim.schedule_wrap(fn), unpack(argv, 1, argc))
80 - end)
81 - running = true
82 - end
83 - end
84 - end
85 - return wrapped_fn, timer
76 + if not running then
77 + timer:start( ms, 0, function ()
78 + running = false
79 + pcall( vim.schedule_wrap( fn ), unpack( argv, 1, argc ) )
80 + end )
81 + running = true
82 + end
83 + end
84 + end
85 + return wrapped_fn, timer
88 88 --- Debounces a function on the leading edge. Automatically `schedule_wrap()`s.
91 91 --@param timeout (number) Timeout in ms
92 92 --@returns (function, timer) Debounced function and timer. Remember to call
93 93 ---`timer:close()` at the end or you will leak memory!
94 -function _.debounce_leading(fn, ms)
95 - td_validate(fn, ms)
96 - local timer = vim.loop.new_timer()
97 - local running = false
94 +function _.debounce_leading( fn, ms )
95 + td_validate( fn, ms )
96 + local timer = vim.loop.new_timer()
97 + local running = false
99 - local function wrapped_fn(...)
100 - timer:start(ms, 0, function()
101 - running = false
102 - end)
99 + local function wrapped_fn( ... )
100 + timer:start( ms, 0, function ()
101 + running = false
102 + end )
104 - if not running then
105 - running = true
106 - pcall(vim.schedule_wrap(fn), select(1, ...))
107 - end
108 - end
109 - return wrapped_fn, timer
104 + if not running then
105 + running = true
106 + pcall( vim.schedule_wrap( fn ), select( 1, ... ) )
107 + end
108 + end
109 + return wrapped_fn, timer
112 112 --- Debounces a function on the trailing edge. Automatically
118 118 ---call to `fn` within the timeframe. Default: Use arguments of the last call.
119 119 --@returns (function, timer) Debounced function and timer. Remember to call
120 120 ---`timer:close()` at the end or you will leak memory!
121 -function _.debounce_trailing(fn, ms, first)
122 - td_validate(fn, ms)
123 - local timer = vim.loop.new_timer()
124 - local wrapped_fn
121 +function _.debounce_trailing( fn, ms, first )
122 + td_validate( fn, ms )
123 + local timer = vim.loop.new_timer()
124 + local wrapped_fn
126 - if not first then
127 - function wrapped_fn(...)
128 - local argv = {...}
129 - local argc = select('#', ...)
126 + if not first then
127 + function wrapped_fn( ... )
128 + local argv = { ... }
129 + local argc = select( '#', ... )
131 - timer:start(ms, 0, function()
132 - pcall(vim.schedule_wrap(fn), unpack(argv, 1, argc))
133 - end)
134 - end
135 - else
136 - local argv, argc
137 - function wrapped_fn(...)
138 - argv = argv or {...}
139 - argc = argc or select('#', ...)
131 + timer:start( ms, 0, function ()
132 + pcall( vim.schedule_wrap( fn ), unpack( argv, 1, argc ) )
133 + end )
134 + end
135 + else
136 + local argv, argc
137 + function wrapped_fn( ... )
138 + argv = argv or { ... }
139 + argc = argc or select( '#', ... )
141 - timer:start(ms, 0, function()
142 - pcall(vim.schedule_wrap(fn), unpack(argv, 1, argc))
143 - end)
144 - end
145 - end
146 - return wrapped_fn, timer
141 + timer:start( ms, 0, function ()
142 + pcall( vim.schedule_wrap( fn ), unpack( argv, 1, argc ) )
143 + end )
144 + end
145 + end
146 + return wrapped_fn, timer
149 149 --- Test deferment methods (`{throttle,debounce}_{leading,trailing}()`).
152 152 --@param ms (number, optional) Timeout in ms, default 2000.
153 153 --@param firstlast (bool, optional) Whether to use the 'other' fn call
154 154 ---strategy.
155 -function _.test_defer(bouncer, ms, firstlast)
156 - local bouncers = {
157 - tl = _.throttle_leading,
158 - tt = _.throttle_trailing,
159 - dl = _.debounce_leading,
160 - dt = _.debounce_trailing,
161 - }
155 +function _.test_defer( bouncer, ms, firstlast )
156 + local bouncers = {
157 + tl = _.throttle_leading,
158 + tt = _.throttle_trailing,
159 + dl = _.debounce_leading,
160 + dt = _.debounce_trailing,
163 - local timeout = ms or 2000
163 + local timeout = ms or 2000
165 - local bounced = bouncers[bouncer](
166 - function(i) vim.cmd('echom "' .. bouncer .. ': ' .. i .. '"') end,
167 - timeout,
168 - firstlast
169 - )
165 + local bounced = bouncers[bouncer](
166 + function ( i ) vim.cmd( 'echom "' .. bouncer .. ': ' .. i .. '"' ) end,
167 + timeout,
168 + firstlast
171 - for i, _ in ipairs{1,2,3,4,5} do
172 - bounced(i)
173 - vim.schedule(function () vim.cmd('echom ' .. i) end)
174 - vim.fn.call("wait", {1000, "v:false"})
175 - end
171 + for i, _ in ipairs { 1, 2, 3, 4, 5 } do
172 + bounced( i )
173 + vim.schedule( function () vim.cmd( 'echom ' .. i ) end )
174 + vim.fn.call( 'wait', { 1000, 'v:false' } )
175 + end
178 178 return _

neovim/lua/std/icon.lua

Modified
108 108 virtual = '󰢔',
109 109 visual = '󰒉',
110 110 warn = '󰱯',
111 + wrap = '󰖶'