repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: ditched custom lsp config in favor of lspconfig

8cbb8b71af22d4eb21efa6c1c66ec6882e9e7873

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (12)

neovim/.lsp.settings.lua

Modified
1 1 local runtime_path = vim.split( package.path, ';' )
2 --- table.insert( runtime_path, vim.fs.joinpath( 'lua', '?.lua' ) )
3 --- table.insert( runtime_path, vim.fs.joinpath( 'lua', '?', 'init.lua' ) )
2 +table.insert( runtime_path, vim.fs.joinpath( 'lua', '?.lua' ) )
3 +table.insert( runtime_path, vim.fs.joinpath( 'lua', '?', 'init.lua' ) )
5 5 return {
6 - LuaLS = {
6 + lua_ls = {
7 7 Lua = {
8 8 runtime = {
9 9 version = 'LuaJIT',
16 16 workspace = {
17 17 ignoreSubmodules = true,
18 - checkThridParties = false,
18 + checkThirdParties = false,
19 19 library = {
20 20 unpack( vim.api.nvim_get_runtime_file( '', true ) ),

neovim/README.md

Modified
8 8 init.lua
9 9 : main entry point
11 +puk.nu
12 +: out-of-band plugin manager
14 +lua/patches
15 +: overrides to built-in lua functions of neovim
11 17 lua/std
12 18 : standard lib. can only depend on itself and neovim apis.
24 30 ftplugin
25 31 : file type specific config
33 +after\queries
34 +: additional treesiter queries
39 49 # todo
41 -* inline simple plugins into config (in-and-out, refjump)
42 -* merge mini-nvim with main config
51 +* neoterm keymaps
52 +* TODO highlights
43 53 * learn mini.operators
44 -* use in-and-out
45 -* get rid of
46 - - cmp
47 - - lazy
48 - - treesj
49 - - gomove
50 - - devicons
51 - - heirline
52 - - luasnip
53 - - nui
54 - - telescope
55 - - surround
56 -* fix nugu floating highlight border background
57 -* indent line bg overwrites visual selection bg
58 -* fix bg highlight of treesitter-context
59 -* stabilize plugins that are only dependencies. move to own file?
60 -* fix markdown rendering in doc popup
61 54 * make highlights more visible when expanding snippets
62 -* kill mason again and get lsps via packages.nu
63 -* simplify lsp config
64 - - make my config identical to vim.lsp.ClientConfig
65 - - fuck all that single file and workspace stuff
66 - - move start function and config creation from lsp/init.lua to ftplugin/*.lua
67 55 * make assignment to map.x fail, e.g. `map.normal = {}`...
68 -* figure out desirable cmp key maps
69 -* try loading lsp async for better startup perf
70 56 * check out `vim.snippet`
71 -* replace cmp with vim.lsp.completion when 0.11 comes out
72 57 * adapt config to respect `vim.g.nerdfont` (std.const?)
73 58 * check out harper-ls
74 59 * check out ast-grep
75 60 * nvim spell for camel case words
76 61 * create skeleton-plugin for default file content based on file type
77 62 (BufNewFile?)
78 -* make lsp config extensible, so that plugin configs can hook into it (e.g.
79 - on_attach)
80 63 * add support for Java multi line string in autopairs

neovim/init.lua

Modified
9 9 -- ▀ ▀
11 11 -- setup debug mode
12 --- require 'std.dbg'.toggle()
12 +require 'std.dbg'.toggle()
14 +local start_time = vim.uv.hrtime()
15 +local measure_startup_time = vim.api.nvim_create_augroup('measure_startup_time', { clear = true })
16 +vim.api.nvim_create_autocmd({ 'VimEnter' }, {
17 + group = measure_startup_time,
18 + desc = 'Measure startup time of neovim.',
19 + once = true,
20 + callback = function()
21 + local end_time = vim.uv.hrtime()
22 + local time_elapsed = end_time - start_time
23 + vim.notify(string.format('Neovim started in (%d ms).', time_elapsed / 1e6))
24 + end,
25 +})
14 27 vim.cmd.colorscheme 'nugu'
16 --- create special global, that serves as a more graceful alternative to `require`
17 -prequire = require 'std.prequire'
19 29 require 'patches'
21 31 require 'bugabinga.options'
22 -require 'bugabinga.lazy'
23 32 require 'bugabinga.sessions'
24 33 require 'bugabinga.treesitter'
34 +require 'bugabinga.neovim_devel'
35 +require 'bugabinga.completion'
25 36 require 'bugabinga.lsp'
26 37 require 'bugabinga.editorconfig'
27 38 require 'bugabinga.save_actions'
28 39 require 'bugabinga.diagnostic'
29 -require 'bugabinga.in-and-out'
40 +require 'bugabinga.in_and_out'
30 41 require 'bugabinga.mkdir'
43 +require 'bugabinga.file_explorer'
44 +require 'bugabinga.virtual_column'
45 +require 'bugabinga.align'
46 +require 'bugabinga.autopairs'
47 +require 'bugabinga.autotag'
48 +require 'bugabinga.colorizer'
49 +require 'bugabinga.cursorword'
50 +require 'bugabinga.devicons'
51 +require 'bugabinga.diff'
52 +require 'bugabinga.format'
53 +require 'bugabinga.jump2d'
54 +require 'bugabinga.lint'
55 +require 'bugabinga.move'
56 +require 'bugabinga.navigation'
57 +require 'bugabinga.notifications'
58 +require 'bugabinga.operators'
59 +require 'bugabinga.specs'
60 +require 'bugabinga.splitjoin'
61 +require 'bugabinga.statusbar'
62 +require 'bugabinga.surround'
63 +require 'bugabinga.textobjects'
64 +require 'bugabinga.key_preview'
66 +require 'bugabinga.incubator'

neovim/lua/bugabinga/file_explorer.lua

Added
new file mode 100644
1 +local puk = require 'std.puk'
2 +local map = require 'std.map'
3 +local icon = require 'std.icon'
5 +local oil = puk 'oil'
7 +oil.setup {
8 + -- default_file_explorer = true,
9 + -- Set to true to watch the filesystem for changes and reload oil
10 + -- experimental_watch_for_changes = true,
11 + skip_confirm_for_simple_edits = true,
12 + prompt_save_on_select_new_entry = false,
13 + delete_to_trash = true,
15 + columns = { 'icon' },
16 + win_options = {
17 + cursorline = true,
18 + },
19 + keymaps = {
20 + ['q'] = 'actions.close',
21 + ['<C-v>'] = 'actions.select_vsplit',
22 + ['<C-s>'] = 'actions.select_split',
23 + ['`'] = 'actions.tcd',
24 + ['~'] = '<cmd>edit $HOME<CR>',
25 + ['<F7>'] = 'actions.open_terminal',
26 + ['gd'] = {
27 + desc = 'Toggle detail view',
28 + callback = function()
29 + local oil = require 'oil'
30 + local config = require 'oil.config'
31 + if #config.columns == 1 then
32 + oil.set_columns { 'icon', 'permissions', 'size', { 'mtime', format = '%d/%m/%y %T' } }
33 + else
34 + oil.set_columns { 'icon' }
35 + end
36 + end,
37 + },
38 + },
39 + float = {
40 + max_width = 69,
41 + min_width = 69,
42 + border = vim.g.border_style,
43 + padding = 2,
44 + },
45 + -- Configuration for the floating keymaps help window
46 + keymaps_help = {
47 + border = vim.g.border_style,
48 + },
49 + view_options = {
50 + is_always_hidden = function(name, bufnr) return name == '..' end,
51 + show_hidden = true,
52 + },
55 +map.normal {
56 + description = 'Open parent directory in buffer.',
57 + category = 'files',
58 + keys = '-',
59 + command = oil.open,

neovim/lua/bugabinga/key_preview.lua

Added
new file mode 100644
1 +local puk = require 'std.puk'
3 +puk.defer 'mini.clue' (function(clue)
4 + clue.setup {
5 + triggers = {
6 + -- Leader triggers
7 + { mode = 'n', keys = '<Leader>' },
8 + { mode = 'x', keys = '<Leader>' },
10 + -- Built-in completion
11 + { mode = 'i', keys = '<C-x>' },
13 + -- `g` key
14 + { mode = 'n', keys = 'g' },
15 + { mode = 'x', keys = 'g' },
17 + -- Marks
18 + { mode = 'n', keys = "'" },
19 + { mode = 'n', keys = '`' },
20 + { mode = 'x', keys = "'" },
21 + { mode = 'x', keys = '`' },
23 + -- Registers
24 + { mode = 'n', keys = '"' },
25 + { mode = 'x', keys = '"' },
26 + { mode = 'i', keys = '<C-r>' },
27 + { mode = 'c', keys = '<C-r>' },
29 + -- Window commands
30 + { mode = 'n', keys = '<C-w>' },
32 + -- `z` key
33 + { mode = 'n', keys = 'z' },
34 + { mode = 'x', keys = 'z' },
35 + },
37 + clues = {
38 + -- Enhance this by adding descriptions for <Leader> mapping groups
39 + { mode = 'n', keys = '<Leader>t', desc = '+Toggle' },
40 + { mode = 'n', keys = '<Leader>l', desc = '+LSP' },
41 + { mode = 'n', keys = '<Leader>lp', desc = '+Peek' },
42 + { mode = 'n', keys = '<Leader>r', desc = '+Rules' },
43 + clue.gen_clues.builtin_completion(),
44 + clue.gen_clues.g(),
45 + clue.gen_clues.marks(),
46 + clue.gen_clues.registers(),
47 + clue.gen_clues.windows(),
48 + clue.gen_clues.z(),
49 + },
50 + }
51 +end)

neovim/lua/bugabinga/lsp/clients/c.lua

Modified
2 2 local project = require 'std.project'
4 4 return {
5 5 name = 'clangd',
6 - command = 'clangd',
7 - filetypes = 'c',
8 6 root_dir = project.find_vcs_project_root,
9 - single_file_support = true,
10 - workspaces = true,
11 7 capabilities = {
12 8 textDocument = {
13 9 completion = {

neovim/lua/bugabinga/lsp/clients/lua.lua

Modified
2 2 local project = require 'std.project'
4 4 return {
5 5 name = 'LuaLS',
6 - filetypes = 'lua',
7 - command = 'lua-language-server',
8 6 root_dir = project.find_lua_project_root,
9 - single_file_support = true,
10 - workspaces = true,
11 7 settings = {
12 8 Lua = {
13 - addonManager = { enable = false, },
14 - completion = { callSnippet = 'Both', },
15 9 hint = { enable = true, setType = true, },
16 10 telemetry = { enable = false, },
17 - window = { progressBar = false, statusBar = false, },
18 - workspace = {
19 - checkThirdParty = false,
20 - library = nil,
21 - },

neovim/lua/bugabinga/lsp/init.lua

Modified
1 -local dbg = require 'std.dbg'
2 -local icon = require 'std.icon'
3 -local defer = require 'std.defer'
4 -local map = require 'std.map'
5 -local auto = require 'std.auto'
6 -local table = require 'std.table'
7 -local ignored = require 'std.ignored'
8 -local user_command = require 'std.user_command'
9 -local lsp_client_configs = require 'bugabinga.lsp.clients'
10 -local localrc = require 'std.localrc'
1 +local puk = require 'std.puk'
2 +local project = require 'std.project'
3 +local dbg = require 'std.dbg'
4 +local icon = require 'std.icon'
5 +local map = require 'std.map'
6 +local auto = require 'std.auto'
7 +local table = require 'std.table'
8 +local localrc = require 'std.localrc'
12 -local _ = {}
14 -local token_update = function ( lsp_client )
15 - local token = lsp_client.data.token
16 - local buffer = lsp_client.buffer
17 - local client_id = lsp_client.data.client_id
18 - local mutable_variable_highlight = 'MutableVariable'
20 - if token.type == 'variable' and not token.modifiers.readonly then
21 - vim.lsp.semantic_tokens.highlight_token( token, buffer, client_id, mutable_variable_highlight )
22 - end
24 - --TODO: find more use cases for semantic tokens
25 - --* global variables
26 - --* functions with side effects
27 - --* closures that capture something
10 +if dbg.get() then
11 + vim.lsp.set_log_level('debug')
30 -local expand_path = function ( path )
31 - if vim.fn.executable( path ) == 1 then
32 - return vim.fn.exepath( path )
33 - else
34 - return path
14 + local settings_override = project_local_lsp_settings[language_server_name]
15 + if settings_override then
16 + return settings_override
38 -local expand_command = function ( command )
39 - vim.validate { command = { command, { 'string', 'table' } } }
41 - if type( command ) == 'table' then
42 - command[1] = expand_path( command[1] )
43 - return command
46 - return expand_path( command )
49 -local lsp_start = function ( file_type_event )
50 - dbg.print 'trying to start lsp'
51 - local match = file_type_event.match
53 - dbg.print( 'filetypes to ignore', ignored.filetypes, 'current filetype', match )
54 - if vim.iter( ignored.filetypes ):find( match ) then return end
56 - local bufnr = file_type_event.buf
57 - local buftype = vim.api.nvim_get_option_value( 'buftype', { buf = bufnr } )
58 - dbg.print( 'buftypes to ignore', ignored.buftypes, 'current buftype', buftype )
59 - if vim.iter( ignored.buftypes ):find( buftype ) then return end
61 - local buffer_path = vim.api.nvim_buf_get_name( bufnr )
63 - dbg.print( string.format( 'searching lsp client for: match: %s, buffer: %s, path: %s', match, bufnr, buffer_path ) )
65 - local potential_client_configs = vim.iter( lsp_client_configs )
66 - :map( function ( config )
67 - vim.validate {
68 - ['config'] = { config, 'table' },
69 - ['config.name'] = { config.name, 'string' },
70 - ['config.filetypes'] = { config.filetypes, { 'string', 'table' } },
71 - ['config.command'] = { config.command, { 'string', 'table' } },
72 - ['config.environment'] = { config.environment, 'table', true },
73 - ['config.root_dir'] = { config.root_dir, 'function', 'string' },
74 - ['config.single_file_support'] = { config.single_file_support, 'boolean', true },
75 - ['config.settings'] = { config.settings, 'table', true },
76 - ['config.workspaces'] = { config.workspaces, 'boolean', true },
77 - ['config.before_init'] = { config.before_init, { 'function', 'table' }, true },
78 - ['config.init_options'] = { config.init_options, 'table', true },
79 - ['config.capabilities'] = { config.capabilities, 'table', true },
80 - ['config.custom_start'] = { config.custom_start, 'function', true },
81 - }
82 - -- normalize scalar values to its vector alternative for easier processing later on
83 - -- this mutates the lsp client configs! careful!
84 - config.command = type( config.command ) == 'string' and { expand_command( config.command ) } or
85 - expand_command( config.command )
86 - config.environment = config.environment or {}
87 - config.filetypes = type( config.filetypes ) == 'string' and { config.filetypes } or config.filetypes
88 - config.single_file_support = config.single_file_support == nil and false or config.single_file_support
89 - config.workspaces = config.workspaces == nil and false or config.workspaces
90 - config.capabilities = config.capabilities or {}
91 - config.init_options = config.init_options or {}
93 - return config
94 - end )
95 - :filter( function ( config )
96 - return vim.iter( config.filetypes ):find( match )
97 - end )
98 - :totable()
100 - dbg.print( 'POTENTIAL CLIENTS',
101 - vim.iter( potential_client_configs ):map( function ( config )
102 - return {
103 - name = config.name,
104 - command =
105 - config.command,
106 - }
107 - end )
108 - :totable() )
110 - if table.is_empty( potential_client_configs ) then
111 - dbg.print( 'found no lsp client for', buffer_path )
112 - return
113 - end
115 - --NOTE: this is super kool but has the limitation, that only lsp clients
116 - -- configured via my special lsp module are affected.
117 - local project_local_lsp_settings = localrc( '.lsp.settings.lua', 'table' ) or {}
118 - local project_local_workspace_folders = localrc( '.lsp.workspace_folders.lua', 'table' ) or {}
120 - -- expand relative workspace paths into lsp.workspaceFolders (name + uri)
121 - for lsp, folders in pairs( project_local_workspace_folders ) do
122 - for idx, path in ipairs( folders ) do
123 - local cwd = vim.uv.cwd()
124 - local abs_path = vim.fs.normalize( vim.fs.joinpath( cwd, path ) )
126 - local exists = vim.uv.fs_stat( abs_path )
127 - if not exists or exists.type ~= 'directory' then
128 - vim.error( 'the project local workspace folder ' ..
129 - abs_path .. ' does not exist or is not a directory.' )
130 - end
132 - project_local_workspace_folders[lsp][idx] = { uri = 'file://' .. abs_path, name = path }
133 - end
134 - end
136 - dbg.print( 'patched project local workspace folders', project_local_workspace_folders )
138 - for _, config in ipairs( potential_client_configs ) do
139 - local path = type( config.command ) == 'table' and config.command[1] or config.command
140 - if vim.fn.executable( path ) ~= 1 then
141 - vim.notify( 'The LSP ' .. config.name .. ' does not seem to be installed!' )
142 - break
143 - end
23 +local language_servers = {
24 + lua_ls = {
25 + root_dir = project.find_lua_project_root,
26 + settings = {
27 + Lua = {
28 + hint = { enable = true, setType = true, },
29 + telemetry = { enable = false, },
30 + },
31 + },
32 + },
33 + -- TODO: take some config from clients/ int here
34 + jdtls = { root_dir = project.find_java_project_root, },
35 + zls = { root_dir = project.find_zig_project_root, },
36 + ziggy = { root_dir = project.find_vcs_project_root, },
37 + ziggy_schema = { root_dir = project.find_vcs_project_root, },
38 + asm_lsp = { root_dir = project.find_vcs_project_root, },
39 + clangd = { root_dir = project.find_vcs_project_root, },
40 + denols = { root_dir = project.find_vcs_project_root, },
41 + dotls = { root_dir = project.find_vcs_project_root, },
42 + docker_compose_language_service = { root_dir = project.find_vcs_project_root, },
43 + dockerls = { root_dir = project.find_vcs_project_root, },
44 + ast_grep = { root_dir = project.find_vcs_project_root, },
45 + cssls = { root_dir = project.find_vcs_project_root, },
46 + css_variables = { root_dir = project.find_vcs_project_root, },
47 + emmet_language_server = { root_dir = project.find_vcs_project_root, },
48 + gopls = { root_dir = project.find_vcs_project_root, },
49 + gradle_ls = { root_dir = project.find_vcs_project_root, },
50 + harper_ls = { root_dir = project.find_vcs_project_root, },
51 + html = { root_dir = project.find_vcs_project_root, },
52 + htmx = { root_dir = project.find_vcs_project_root, },
53 + hyprls = { root_dir = project.find_vcs_project_root, },
54 + jsonls = { root_dir = project.find_vcs_project_root, },
55 + lemminx = { root_dir = project.find_vcs_project_root, },
56 + lsp_ai = { root_dir = project.find_vcs_project_root, },
57 + ltex = { root_dir = project.find_vcs_project_root, },
58 + marksman = { root_dir = project.find_vcs_project_root, },
59 + markdown_oxide = { root_dir = project.find_vcs_project_root, },
60 + nil_ls = { root_dir = project.find_vcs_project_root, },
61 + nixd = { root_dir = project.find_vcs_project_root, },
62 + nushell = { root_dir = project.find_vcs_project_root, },
63 + ocamllsp = { root_dir = project.find_vcs_project_root, },
64 + protols = { root_dir = project.find_vcs_project_root, },
65 + roc_ls = { root_dir = project.find_vcs_project_root, },
66 + rust_analyzer = { root_dir = project.find_vcs_project_root, },
67 + statix = { root_dir = project.find_vcs_project_root, },
68 + superhtml = { root_dir = project.find_vcs_project_root, },
69 + tabby_ml = { root_dir = project.find_vcs_project_root, },
70 + taplo = { root_dir = project.find_vcs_project_root, },
71 + ts_ls = { root_dir = project.find_vcs_project_root, },
72 + zk = { root_dir = project.find_vcs_project_root, },
75 +puk.defer 'lspconfig' (function(lspconfig)
76 + for server, config in pairs(language_servers) do
145 77 local capabilities = vim.lsp.protocol.make_client_capabilities()
146 - capabilities = table.extend( 'force', capabilities, config.capabilities )
148 - local settings = config.settings
149 - local settings_override = project_local_lsp_settings[config.name]
150 - if settings_override then
151 - dbg.print( 'overriding settings with project local settings', settings, settings_override )
152 - settings = vim.tbl_deep_extend( 'force', settings, settings_override )
153 - end
155 - local root_dir = type( config.root_dir ) == 'string' and config.root_dir or config.root_dir( buffer_path )
156 - local root_workspace = root_dir and { uri = 'file://' .. root_dir, name = root_dir } or nil
157 - local workspace_folders = root_workspace and { root_workspace } or nil
158 - local workspace_folders_local = project_local_workspace_folders[config.name]
159 - if not workspace_folders_local then dbg.print( 'no local workspace folders found for ' .. config.name ) end
160 - if workspace_folders_local and config.workspaces then
161 - dbg.print( 'setting workspace folders to project local workspace folders', workspace_folders_local )
162 - workspace_folders = workspace_folders and
163 - vim.tbl_deep_extend( 'force', workspace_folders, workspace_folders_local ) or workspace_folders_local
164 - end
166 - dbg.print( 'starting command:', config.command )
168 - local start_config = {
169 - cmd = config.command,
170 - cmd_cwd = root_dir,
171 - -- cmd_env = config.environment,
172 - detached = false, -- do i want this?
173 - root_dir = root_dir,
174 - workspace_folders = workspace_folders,
175 - capabilities = capabilities,
176 - -- handlers = vim.lsp.handlers,
177 - settings = settings,
178 - -- commands = nil, -- what is this?
179 - init_options = config.init_options,
180 - name = config.name,
181 - -- get_language_id = nil,
182 - -- offset_encoding = nil,
183 - on_error = function ( code, ... ) vim.print( 'LSP ERROR', code, ... ) end,
184 - before_init = config.before_init,
185 - -- on_init = nil, -- should i send workspace/didChangeConfiguration here?
186 - on_exit = function ( code, signal, client_id ) dbg.print( 'LSP CLIENT EXIT', code, signal, client_id ) end,
187 - on_attach = function ( client, attach_bufnr ) dbg.print( 'LSP CLIENT ATTACH', client, attach_bufnr ) end,
188 - trace = dbg.get() and 'on' or 'off',
189 - flags = { allow_incremental_sync = true, debounce_text_changes = 250, exit_timeout = 200 },
190 - }
192 - local lsp_starter = config.custom_start or vim.lsp.start
194 - dbg.print( 'starting lsp', start_config.name, root_dir )
196 - lsp_starter( start_config, {
197 - bufnr = bufnr,
198 - -- TODO: reuse if workspaces
199 - -- local supported = vim.tbl_get(client, 'server_capabilities', 'workspace', 'workspaceFolders', 'supported')
200 - reuse_client = function ( existing_client, new_config )
201 - dbg.print(
202 - 'lsp reuse client',
203 - existing_client.name,
204 - existing_client.workspace_folders,
205 - new_config.name,
206 - new_config.root_dir
207 - )
209 - --TODO lsps with single file or worksopaces support do not need smame root dir. instead add_workspace_folder
210 - local same_name = existing_client.name == new_config.name
212 - local new_root_raw = new_config.root_dir or nil
213 - local existing_root_raw = existing_client.workspace_folders and #existing_client.workspace_folders >= 1 and
214 - existing_client.workspace_folders[1].name or nil
216 - if not (new_root_raw and existing_root_raw) then return false end
218 - local new_root = vim.fs.normalize( new_root_raw )
219 - local existing_root = vim.fs.normalize( existing_root_raw )
220 - local same_root = new_root == existing_root
222 - local reuse = same_name and same_root
223 - dbg.print( 'reusing lsp client?', reuse )
224 - return reuse
225 - end,
226 - } )
228 - dbg.print( 'STARTING LSP CLIENT', config.name )
78 + config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
79 + capabilities = table.extend('force', capabilities, config.capabilities)
80 + local settings = config.settings or {}
81 + local settings_override = local_settings(server) or {}
82 + config.settings = table.extend('force', settings, settings_override)
83 + lspconfig[server].setup(config)
230 -end
85 +end)
233 --- FIXME: move to own file with LspAttach instead, so that those settings are
234 --- applied to all LSPs, not only those managed by my configs.
235 -local lsp_attach = function ( args )
87 +local lsp_attach = function(args)
236 88 local bufnr = args.buf
237 89 local client_id = args.data.client_id
238 - local client = vim.lsp.get_client_by_id( client_id )
90 + local client = vim.lsp.get_client_by_id(client_id)
239 91 if not client then return end
241 - dbg.print( client.server_capabilities )
243 - if client.server_capabilities.definitionProvider then
244 - vim.bo[bufnr].tagfunc = 'v:lua.vim.lsp.tagfunc'
245 - end
247 - if client.server_capabilities.documentFormattingProvider then
248 - vim.bo[bufnr].formatexpr = 'v:lua.vim.lsp.formatexpr'
249 - end
251 - if client.server_capabilities.completionProvider then
252 - vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc'
253 - end
93 + vim.lsp.completion.enable(true, client_id, bufnr)
255 95 if client.server_capabilities.inlayHintProvider then
256 96 map.normal {
258 98 category = 'lsp',
259 99 buffer = bufnr,
260 100 keys = '<leader>ti',
261 - command = function ()
262 - vim.lsp.inlay_hint.enable( not vim.lsp.inlay_hint.is_enabled() )
101 + command = function()
102 + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
267 - map.normal {
268 - description = 'Show hover documentation above cursor.',
269 - category = 'lsp',
270 - buffer = bufnr,
271 - keys = { 'K', '<leader>lk' },
272 - command = vim.lsp.buf.hover,
273 - }
275 - map.insert {
276 - description = 'Show signature help under cursor.',
277 - category = 'lsp',
278 - buffer = bufnr,
279 - keys = { '<C-h>' },
280 - command = vim.lsp.buf.signature_help,
281 - }
283 - map.normal {
284 - description = 'Show available code actions on current line.',
285 - category = 'lsp',
286 - buffer = bufnr,
287 - keys = '<leader>la',
288 - command = vim.lsp.buf.code_action,
289 - }
291 - map.normal {
292 - description = 'Goto to definition of symbol under cursor.',
293 - category = 'lsp',
294 - buffer = bufnr,
295 - keys = '<leader>ld',
296 - command = vim.lsp.buf.definition,
297 - }
299 - map.normal {
300 - description = 'Show implementations of symbol under cursor.',
301 - category = 'lsp',
302 - buffer = bufnr,
303 - keys = '<leader>li',
304 - command = vim.lsp.buf.implementation,
305 - }
307 - map.normal {
308 - description = 'Show incoming calls of symbol under cursor.',
309 - category = 'lsp',
310 - buffer = bufnr,
311 - keys = '<leader>lc',
312 - command = vim.lsp.buf.incoming_calls,
313 - }
315 - map.normal {
316 - description = 'Show outgoing calls of symbol under cursor.',
317 - category = 'lsp',
318 - buffer = bufnr,
319 - keys = '<leader>lC',
320 - command = vim.lsp.buf.outgoing_calls,
321 - }
323 - map.normal {
324 - description = 'Show references of symbol under cursor.',
325 - category = 'lsp',
326 - buffer = bufnr,
327 - keys = '<leader>ln',
328 - command = vim.lsp.buf.references,
329 - }
331 - map.normal {
332 - description = 'Rename symbol under cursor.',
333 - category = 'lsp',
334 - buffer = bufnr,
335 - keys = { '<f2>', '<leader>lr' },
336 - command = vim.lsp.buf.rename,
337 - }
340 108 auto 'lsp' {
341 - {
342 - description = 'Start or reuse LSP client',
343 - events = 'FileType',
344 - command = lsp_start,
345 - },
346 - {
347 - description = 'Hook: LSP client attached to buffer',
348 - events = 'LspAttach',
349 - command = lsp_attach,
350 - },
351 - {
352 - description = 'Semantic Tokens from the LSP',
353 - events = 'LspTokenUpdate',
354 - command = token_update,
355 - },
109 + description = 'lsp: client attached to buffer',
110 + events = 'LspAttach',
111 + command = lsp_attach,
358 -local lsp_info = function ( command )
359 - local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0 }
360 - local active_clients = vim.lsp.get_clients( all_or_current )
362 - local infos = vim.iter( active_clients )
363 - :map( function ( client )
364 - local name = client.name
365 - local config = vim.iter( lsp_client_configs ):find( function ( config ) return config.name == name end )
366 - assert( config, ('How did we not find a config for %s ?!?!'):format( name ) )
368 - local full_cmd = table.deep_copy( client.config.cmd )
369 - full_cmd[1] = vim.fn.exepath( full_cmd[1] )
370 - local basic = {
371 - id = client.id,
372 - name = name,
373 - cmd = table.concat( full_cmd, ' ' ),
374 - workspace_folders = vim.iter( client.workspace_folders ):map( function ( w ) return vim.fs.normalize( w.name ) end )
375 - :totable(),
376 - filetypes = table.concat( config.filetypes, ', ' ),
377 - single_file_support = config.single_file_support,
378 - workspaces = config.workspaces,
379 - }
380 - return basic
381 - end )
382 - :totable()
384 - vim.print( vim.inspect( infos ) )
385 -end
387 -local lsp_info_extended = function ( command )
388 - local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0 }
389 - local active_clients = vim.lsp.get_clients( all_or_current )
390 - vim.print( vim.inspect( active_clients ) )
391 -end
393 -user_command.LspInfo
394 -'Shows basic information about running LSP clients.'
395 - { nargs = '?', complete = function () return { 'all' } end } (
396 - lsp_info
397 - )
399 -user_command.LspInfoExtended
400 -'Shows detailed information about running LSP clients.'
401 - { nargs = '?', complete = function () return { 'all' } end } (
402 - lsp_info_extended
403 - )
405 --- TODO: LspStart
406 --- TODO: LspStop
407 --- TODO: LspRestart ? Maybe good after changing project local settings?
409 114 local completion_icons = {
410 115 Class = icon.class,
411 116 Color = icon.color,
433 138 local completion_kinds = vim.lsp.protocol.CompletionItemKind
434 -for i, kind in ipairs( completion_kinds ) do
139 +for i, kind in ipairs(completion_kinds) do
435 140 completion_kinds[i] = completion_icons[kind] or kind
438 --- style the lsp hover window
439 -vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
440 - vim.lsp.handlers.hover, {
441 - border = vim.g.border_style,
442 - title = ' ' .. icon.hover .. ' ',
443 - }
446 -return setmetatable( _, {} )

neovim/lua/bugabinga/plugins/incubator.lua

Modified
2 2 -- this file lists plugins in their "incubation" phase.
3 3 -- that means i am testing those out of curiosity, but am not sure yet i wish
4 4 -- to use and depend on them.
6 --- global toggle for all incubating plugins. set to false to quickly, but
7 --- temporarily, get rid of all incubating plugins.
8 -local FUCK_STABILITY = true
6 +local puk = require 'std.puk'
7 +local auto = require 'std.auto'
8 +local map = require 'std.map'
10 9 local icon = require 'std.icon'
11 10 local const = require 'std.const'
12 11 local dbg = require 'std.dbg'
13 12 local ignored = require 'std.ignored'
15 -return {
16 - -------------------------------------------------------------------------------
17 - --- does not yet restore well with session
18 - --- cannot navigate with C-w inside the DocsView
19 - --- it has a manual update mode, but which key to bind it to?
20 - {
21 - 'amrbashir/nvim-docs-view',
22 - keys = {
23 - {
24 - '<leader>tk',
25 - '<cmd>DocsViewToggle<cr>',
26 - mode = { 'n' },
27 - desc = 'Toggle stable documentation panel.',
28 - },
14 +-------------------------------------------------------------------------------
15 +--- does not yet restore well with session
16 +--- cannot navigate with C-w inside the DocsView
17 +--- it has a manual update mode, but which key to bind it to?
18 +puk.defer 'docs-view' (function(docsview)
19 + docsview.setup {
20 + position = 'right',
21 + width = 42,
22 + }
23 + map.normal {
24 + description = 'Toggle stable documentation panel.',
25 + keys = '<leader>tk',
26 + command = '<cmd>DocsViewToggle<cr>',
27 + }
28 +end)
29 +-------------------------------------------------------------------------------
30 +--- this is pretty great! i just need better binds and tell which key about them
31 +puk.defer 'rulebook' (function(rulebook)
32 + rulebook.setup ()
33 + map.normal {
34 + description = 'ignore rule',
35 + category = 'lint',
36 + keys = '<leader>ri',
37 + command = rulebook.ignoreRule,
38 + }
39 + map.normal {
40 + description = 'lookup rule',
41 + category = 'lint',
42 + keys = '<leader>rl',
43 + command = rulebook.lookupRule,
44 + }
45 + map.normal {
46 + description = 'yank diagnostic code',
47 + category = 'lint',
48 + keys = '<leader>ry',
49 + command = rulebook.yankDiagnosticCode,
50 + }
51 + map.normal {
52 + description = 'supress formatter',
53 + category = 'lint',
54 + keys = '<leader>rf',
55 + command = rulebook.suppressFormatter,
56 + }
57 +end)
58 +-------------------------------------------------------------------------------
59 +--- this plugin has some sick visual text formatting chops. check them out some time.
60 +puk.defer 'symbol-usage'(function(symbolusage)
61 + symbolusage.setup {
62 + hi = { link = 'LineNr' },
63 + vt_position = 'end_of_line',
64 + request_pending_text = false,
65 + disable = {
66 + filetypes = ignored.filetypes,
30 - cmd = 'DocsViewToggle',
31 - opts = {
32 - position = 'right',
33 - width = 42,
34 - },
35 - enabled = FUCK_STABILITY,
36 - },
37 - -------------------------------------------------------------------------------
38 - --- look into demicolon.nvim for ,; repition
39 - {
40 - 'mawkler/refjump.nvim',
41 - dependencies = {
43 - },
44 - keys = { ']r', '[r' },
45 - opts = {},
46 - enabled = FUCK_STABILITY,
47 - },
48 - -------------------------------------------------------------------------------
49 - --- this is pretty great! i just need better binds and tell which key about them
50 - {
51 - 'chrisgrieser/nvim-rulebook',
52 - keys = {
53 - { '<leader>ri', function () require 'rulebook'.ignoreRule() end },
54 - { '<leader>rl', function () require 'rulebook'.lookupRule() end },
55 - { '<leader>ry', function () require 'rulebook'.yankDiagnosticCode() end },
56 - { '<leader>sf', function () require 'rulebook'.suppressFormatter() end, mode = { 'n', 'x' } },
57 - },
58 - enabled = FUCK_STABILITY,
59 - },
60 - -------------------------------------------------------------------------------
61 - --- this plugin has some sick visual text formatting chops. check them out some time.
62 - {
63 - 'Wansmer/symbol-usage.nvim',
64 - event = 'LspAttach',
65 - opts = {
66 - hi = { link = 'LineNr' },
67 - vt_position = 'end_of_line',
68 - request_pending_text = false,
69 - disable = {
70 - filetypes = ignored.filetypes,
71 - },
72 - log = { enabled = dbg.get() },
73 - },
74 - enabled = FUCK_STABILITY,
75 - },
76 - -------------------------------------------------------------------------------
77 - --- Pretty NICE!
78 - --- fix highlights to match nugu.
79 - {
80 - 'dnlhc/glance.nvim',
81 - event = 'LspAttach',
82 - keys = {
83 - { '<Leader>gd', '<cmd>Glance definitions<cr>', { silent = true }, desc = 'Peek definitions', mode = 'n' },
84 - { '<Leader>gr', '<cmd>Glance references<cr>', { silent = true }, desc = 'Peek refernces', mode = 'n' },
85 - { '<Leader>gy', '<cmd>Glance type_definitions<cr>', { silent = true }, desc = 'Peek type definitions', mode = 'n' },
86 - { '<Leader>gm', '<cmd>Glance implementations<cr>', { silent = true }, desc = 'Peek implementations', mode = 'n' },
87 - },
88 - config = true,
89 - enabled = FUCK_STABILITY,
90 - },
91 - -------------------------------------------------------------------------------
92 - {
93 - 'emmanueltouzery/decisive.nvim',
94 - config = function ()
95 - require 'decisive'.setup {}
96 - end,
97 - ft = { 'csv' },
98 - keys = {
99 - { '<leader>cca', ":lua require('decisive').align_csv({})<cr>", { silent = true }, desc = 'Align CSV', mode = 'n' },
100 - { '<leader>ccA', ":lua require('decisive').align_csv_clear({})<cr>", { silent = true }, desc = 'Align CSV clear', mode = 'n' },
101 - { '[c', ":lua require('decisive').align_csv_prev_col()<cr>", { silent = true }, desc = 'Align CSV prev col', mode = 'n' },
102 - { ']c', ":lua require('decisive').align_csv_next_col()<cr>", { silent = true }, desc = 'Align CSV next col', mode = 'n' },
103 - },
104 - enabled = FUCK_STABILITY,
105 - },
106 - -------------------------------------------------------------------------------
107 - --- fix nugu highlights (also snippet highlights)
108 - --- configure with custom snippets?
109 - {
110 - 'saghen/blink.cmp',
111 - lazy = false, -- lazy loading handled internally
112 - -- use a release tag to download pre-built binaries
113 - version = 'v0.*',
114 - ---@module 'blink.cmp'
115 - ---@type blink.cmp.Config
116 - opts = {
117 - -- 'default' for mappings similar to built-in completion
118 - -- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate)
119 - -- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept
120 - -- see the "default configuration" section below for full documentation on how to define
121 - -- your own keymap.
122 - keymap = { preset = 'default' },
124 - highlight = {
125 - -- sets the fallback highlight groups to nvim-cmp's highlight groups
126 - -- useful for when your theme doesn't support blink.cmp
127 - -- will be removed in a future release, assuming themes add support
128 - use_nvim_cmp_as_default = true,
129 - },
130 - -- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
131 - -- adjusts spacing to ensure icons are aligned
132 - nerd_font_variant = 'normal',
134 - -- default list of enabled providers defined so that you can extend it
135 - -- elsewhere in your config, without redefining it, via `opts_extend`
136 - sources = {
137 - completion = {
138 - enabled_providers = { 'lsp', 'path', 'snippets', 'buffer' },
139 - },
140 - },
142 - -- experimental auto-brackets support
143 - accept = { auto_brackets = { enabled = true } },
145 - -- experimental signature help support
146 - trigger = { signature_help = { enabled = true } },
147 - },
148 - -- allows extending the enabled_providers array elsewhere in your config
149 - -- without having to redefine it
150 - opts_extend = { 'sources.completion.enabled_providers' },
151 - },
152 - -------------------------------------------------------------------------------
68 + log = { enabled = dbg.get() },
69 + }
70 +end)
71 +-------------------------------------------------------------------------------
72 +--- Pretty NICE!
73 +--- fix highlights to match nugu.
74 +puk.defer 'glance' (function(glance)
75 + glance.setup()
76 + map.normal {
77 + description = 'peek definitions',
78 + category = 'lsp',
79 + keys = '<Leader>lpd',
80 + command = '<cmd>Glance definitions<cr>',
81 + }
82 + map.normal {
83 + description = 'Peek references',
84 + category = 'lsp',
85 + keys = '<Leader>lpr',
86 + command = '<cmd>Glance references<cr>',
87 + }
88 + map.normal {
89 + description = 'Peek type definitions',
90 + category = 'lsp',
91 + keys = '<Leader>lpt',
92 + command = '<cmd>Glance type_definitions<cr>',
93 + }
94 + map.normal {
95 + description = 'Peek implementations',
96 + keys = '<Leader>lpi',
97 + command = '<cmd>Glance implementations<cr>',
98 + }
99 +end)
100 +-------------------------------------------------------------------------------

neovim/lua/bugabinga/splitjoin.lua

Added
new file mode 100644
1 +local puk = require 'std.puk'
2 +local map = require 'std.map'
3 +local auto = require 'std.auto'
5 +local treesj = puk 'treesj'
6 +local splitjoin = puk 'mini.splitjoin'
8 +treesj.setup {
9 + use_default_keymaps = false,
10 + max_join_length = 360,
12 +splitjoin.setup()
14 +map.normal {
15 + description = 'Toggle Tree Join/Split',
16 + category = 'editing',
17 + keys = '<c-j>',
18 + command = function()
19 + local langs = require 'treesj.langs'['presets']
20 + if langs[vim.bo.filetype] then
21 + treesj.toggle { split = { recursive = false } }
22 + else
23 + splitjoin.toggle()
24 + end
25 + end,

neovim/lua/std/project.lua

Modified
1 -local debug = require 'std.dbg'
2 1 local table = require 'std.table'
4 3 local join = table.join
10 9 local cache = {}
11 10 local hasher = vim.fn.sha256
12 -local markers_to_string = function ( markers )
13 - return vim.inspect( markers )
11 +local markers_to_string = function(markers)
12 + return vim.inspect(markers)
15 -local create_hash = function ( path, markers, stop )
16 - local path_hash = hasher( path )
17 - local stop_hash = hasher( stop )
18 - local markers_hash = hasher( markers_to_string( markers ) )
14 +local create_hash = function(path, markers, stop)
15 + local path_hash = hasher(path)
16 + local stop_hash = hasher(stop)
17 + local markers_hash = hasher(markers_to_string(markers))
19 18 local hash = path_hash .. '|' .. markers_hash .. '|' .. stop_hash
20 19 return hash
22 -local cache_get = function ( path, markers, stop )
23 - local hash = create_hash( path, markers, stop )
21 +local cache_get = function(path, markers, stop)
22 + local hash = create_hash(path, markers, stop)
24 23 local hit = cache[hash]
25 24 return hit
27 -local cache_set = function ( project_root, path, markers, stop )
28 - local hash = create_hash( path, markers, stop )
26 +local cache_set = function(project_root, path, markers, stop)
27 + local hash = create_hash(path, markers, stop)
29 28 cache[hash] = project_root
32 -local expand = function ( path ) return vim.fn.fnamemodify( path, ':p' ) end
31 +local expand = function(path) return vim.fn.fnamemodify(path, ':p') end
34 33 --- number of max loop iterations when searching for markers
35 34 local MAX_TRAVERSAL_COUNT = 100
70 69 ---@param stop string? The last directory on the path to root, when to stop searching. if `nil`, the users home
71 70 ---directory is used.
72 71 ---@return string? # Directory, that contains the `markers` and lies on the path from `path` to `stop`.
73 -local function find_root( path, markers, stop )
72 +local function find_root(path, markers, stop)
74 73 validate {
75 74 path = { path, 'string', true, },
76 75 markers = { markers, 'table', },
77 76 stop = { stop, 'string', true, },
80 - path = path or dirname( vim.api.nvim_buf_get_name( 0 ) )
81 - path = dirname( normalize( expand( path ) ) )
79 + path = path or dirname(vim.api.nvim_buf_get_name(0))
80 + path = dirname(normalize(expand(path)))
82 81 stop = stop or vim.uv.os_homedir()
83 - stop = normalize( stop )
82 + stop = normalize(stop)
85 - if not exists( stop ) then error( ('the stop directory %s does not exist!'):format( stop ) ) end
84 + if not exists(stop) then error(('the stop directory %s does not exist!'):format(stop)) end
87 86 if #path == 0 then return nil end
89 - local cache_hit = cache_get( path, markers, stop )
88 + local cache_hit = cache_get(path, markers, stop)
90 89 if cache_hit then
91 - debug.print( 'CACHE HIT', cache_hit )
92 90 return cache_hit
104 102 local current_path = path
105 103 while current_path ~= stop do
106 104 if loop_count > MAX_TRAVERSAL_COUNT then
107 - debug.print( ('searching for markers reached the max traversal count for path %s !'):format( path ) )
115 112 markers = {},
118 - for _, marker in ipairs( markers ) do
115 + for _, marker in ipairs(markers) do
119 116 local marker_path = current_path .. '/' .. marker.name
120 - if exists( marker_path ) then
117 + if exists(marker_path) then
121 118 score.marker_count = score.marker_count + marker.weight
122 - table.insert( score.markers, marker_path )
119 + table.insert(score.markers, marker_path)
126 123 if score.marker_count > 0 then
127 - table.insert( directory_scores, score )
124 + table.insert(directory_scores, score)
130 - current_path = dirname( current_path )
127 + current_path = dirname(current_path)
132 129 current_distance_to_buffer = current_distance_to_buffer + 1
133 130 loop_count = loop_count + 1
141 138 -- then it could be a nested project structure (multi-module).
142 139 -- in those cases we are looking for the root project folder, instead the nearest
143 140 -- child project root folder.
144 - for _, score in ipairs( directory_scores ) do
141 + for _, score in ipairs(directory_scores) do
145 142 local likelyhood = score.marker_count * (1 / score.distance_to_buffer_file)
146 - if debug.get() then score.likelyhood = likelyhood end
147 143 if likelyhood > max_likelyhood then
148 144 max_likelyhood = likelyhood
149 145 project_root = score.path
152 148 if project_root then
153 - cache_set( project_root, path, markers, stop )
149 + cache_set(project_root, path, markers, stop)
155 - debug.print( 'found project root', project_root, directory_scores )
156 151 return project_root
163 158 ---@return string? # The project root of the current buffer, or `nil`, if none could be determined.
165 -local function find_project_root( path, markers )
160 +local function find_project_root(path, markers)
166 161 -- define some language-independent markers
167 162 local default_markers = {
168 163 { name = '.save.actions.lua', weight = DEFINITELY, },
189 184 markers = markers or {}
190 - return find_root( path, join( default_markers, markers ) )
185 + return find_root(path, join(default_markers, markers))
193 -local function find_vcs_project_root( path )
194 - return find_project_root( path, {} )
188 +local function find_vcs_project_root(path)
189 + return find_project_root(path, {})
197 -local function find_java_project_root( path )
192 +local function find_java_project_root(path)
198 193 local java_markers = {
199 194 { name = '.idea', weight = LIKELY, },
200 195 { name = '.classpath', weight = LIKELY, },
211 206 { name = 'gradlew', weight = DEFINITELY, },
212 207 { name = 'gradlew.bat', weight = DEFINITELY, },
214 - return find_project_root( path, java_markers )
209 + return find_project_root(path, java_markers)
217 -local find_lua_project_root = function ( path )
212 +local find_lua_project_root = function(path)
218 213 local lua_markers = {
219 214 { name = '.luarc.json', weight = MAYBE, },
220 215 { name = '.luarc.jsonc', weight = MAYBE, },
227 222 { name = 'lua', weight = MAYBE, },
230 - return find_project_root( path, lua_markers )
225 + return find_project_root(path, lua_markers)
233 -local find_zig_project_root = function ( path )
228 +local find_zig_project_root = function(path)
234 229 local zig_markers = {
235 230 { name = 'build.zig', weight = DEFINITELY, },
236 231 { name = 'zls.build.json', weight = DEFINITELY, },
241 236 --FIXME: can we ask the zig build system for this info?
242 - return find_project_root( path, zig_markers )
237 + return find_project_root(path, zig_markers)
245 -local find_rust_project_root = function ( path )
240 +local find_rust_project_root = function(path)
246 241 local markers = {
247 242 { name = 'Cargo.toml', weight = DEFINITELY, },
249 - local cargo_crate_dir = find_project_root( path, markers )
244 + local cargo_crate_dir = find_project_root(path, markers)
250 245 if cargo_crate_dir == nil then return nil end
252 247 local cmd = {
256 251 '--format-version',
258 253 '--manifest-path',
259 - vim.fs.joinpath( cargo_crate_dir, 'Cargo.toml' ),
254 + vim.fs.joinpath(cargo_crate_dir, 'Cargo.toml'),
262 - local result = vim.system( cmd, { text = true, } ):wait()
257 + local result = vim.system(cmd, { text = true, }):wait()
263 258 local cargo_workspace_root
265 260 if result.code == 0 then
266 - local json = vim.json.decode( result.stdout )
261 + local json = vim.json.decode(result.stdout)
267 262 if json['workspace_root'] then
268 - cargo_workspace_root = vim.fs.normalize( json['workspace_root'] )
263 + cargo_workspace_root = vim.fs.normalize(json['workspace_root'])
272 267 return cargo_workspace_root or cargo_crate_dir
275 -local fallback_rooter = function ( path )
276 - return find_vcs_project_root( path ) or find_project_root( path )
270 +local fallback_rooter = function(path)
271 + return find_vcs_project_root(path) or find_project_root(path)
278 273 local rooters = {
279 274 java = find_java_project_root,
282 277 zig = find_zig_project_root,
285 -local find_root_by_filetype = function ( path, filetype )
280 +local find_root_by_filetype = function(path, filetype)
286 281 local rooter = rooters[filetype]
287 - return rooter and rooter( path ) or fallback_rooter( path )
282 + return rooter and rooter(path) or fallback_rooter(path)
290 285 return {

neovim/puk.plugins.nuon

Modified
1 -# vim: ft=nu
3 - [name, source, repo, commit, build];
5 - ## IMPORTANT ONES
6 - [nvim-treesitter, github, 'nvim-treesitter/nvim-treesitter', "fc940eaf106981a92829518e977e46ad4f306472", null],
7 - [nvim-treesitter-textobjects, github, 'nvim-treesitter/nvim-treesitter-textobjects', "e0a7b5a6b7f18a5d508d05ca8853273db7bcbe50", null],
8 - [nvim-ts-autotag, github, 'windwp/nvim-ts-autotag', "e239a560f338be31337e7abc3ee42515daf23f5e", null],
9 - ["oil", github, 'stevearc/oil.nvim', "3c2de37accead0240fbe812f5ccdedfe0b973557", null],
10 - [blink, github, 'Saghen/blink.cmp', '180be7ba574033baa30fa8af0db4f59db7353584', [cargo build '--release'] ],
11 - [ivy, github, 'AdeAttwood/ivy.nvim', 'cfa7e29ae4d955508d4f7f2ef08cc0c51ee745ed', [cargo build '--release'] ],
12 - [nvim-surround, github, 'kylechui/nvim-surround', 'dca2e998ff26681ee422b92c6ed39b3d2908d8a9', null ],
13 - [neoterm, github, 'itmecho/neoterm.nvim', '23a780136892b1128485f20d772a771e528b651b', null ],
14 - ["conform", github, 'stevearc/conform.nvim', "6239d9986f51ca93ded99ecdb1af0e287eabb651", null],
15 - ["fidget", github, 'j-hui/fidget.nvim', "ef99df04a1c53a453602421bc0f756997edc8289", null],
16 - ["heirline", github, "rebelot/heirline.nvim", "cc359b628266cb9a84b2d71c883f2b99e16473a0", null],
17 - ["mini.bracketed", github, 'echasnovski/mini.bracketed', "833d66df6e0588222312a963780c6ec42ed7437d", null],
18 - ["mini.align", github, 'echasnovski/mini.align', "26111a737494bc39576ad67b52bbc2638ca23553", null],
19 - ["mini.cursorword",github, "echasnovski/mini.cursorword", "7d1b38a17834acbbc4feff8e42aedc4ed0c6ff06", null],
20 - ["mini.diff",github, "echasnovski/mini.diff", "24d46798be8a358d38d3adc92c7ebcbb2d6f67e0", null],
21 - ["mini.jump2d",github, "echasnovski/mini.jump2d", "b0963aa2ec80b4b1ed1c7f93d9c969bb3f4b65b6", null],
22 - ["mini.operators",github, "echasnovski/mini.operators", "35b12f54bd5acb860f4297fd6d12fd07b1b065e2", null],
23 - ['mini.move', github, 'echasnovski/mini.move', "4caa1c212f5ca3d1633d21cfb184808090ed74b1", null],
24 - ['mini.icons', github, 'echasnovski/mini.icons', "54686be7d58807906cb2c8c2216e0bf9c044f19a", null],
25 - [nvim-autopairs, github, 'windwp/nvim-autopairs', "f158dcb865c36f72c92358f87787dab2c272eaf3", null],
26 - [nvim-highlight-colors, github, 'brenoprata10/nvim-highlight-colors', "e967e2ba13fd4ca731b41d0e5cc1ac2edcd6e25e", null],
27 - [lint, github, 'mfussenegger/nvim-lint', "968a35d54b3a4c1ce66609cf80b14d4ae44fe77f", null],
28 - [treesj, github, 'Wansmer/treesj', "03415ac60791d48e120a80d37e080744faf3ac15", null],
29 - ["virt-column", github, 'lukas-reineke/virt-column.nvim', "b87e3e0864211a32724a2ebf3be37e24e9e2fa99", null],
30 - ["specs", github, 'edluffy/specs.nvim', "2743e412bbe21c9d73954c403d01e8de7377890d", null],
32 - ## INLINING CANDIDATES
34 - ## INCUBATOR
35 - ["decisive", github, 'emmanueltouzery/decisive.nvim', "a7251adebccbc9c899cff39a524b20d06e2b78b5", null],
36 - ["glance", github, 'DNLHC/glance.nvim', "17ee84e29ac33e7e5d91609f675cee8477586bda", null],
37 - ["iswap", github, "mizlan/iswap.nvim", "e02cc91f2a8feb5c5a595767d208c54b6e3258ec", null],
38 - [docs-view, github, 'amrbashir/nvim-docs-view',"365593534e0acd762bfddce6e8313315ffa4fa36", null],
39 - [rulebook, github, 'chrisgrieser/nvim-rulebook', "528857a6e522396c2ded41cb24e694fb3f177429", null],
40 - ["symbol-usage", github, 'Wansmer/symbol-usage.nvim', "0f9b3da014b7e41559b643e7461fcabb2a7dc83a", null],
2 + [
3 + name,
4 + source,
5 + repo,
6 + branch,
7 + commit,
8 + build
9 + ];
10 + [
11 + lspconfig,
12 + github,
13 + neovim/nvim-lspconfig,
14 + main,
15 + "1aa9f36b6d542dafc0b4a38c48969d036003b00a",
16 + null
17 + ],
18 + [
19 + nvim-treesitter,
20 + github,
21 + nvim-treesitter/nvim-treesitter,
22 + main,
23 + "c4a22ce846d8c15cfe86469ef557d5b9860ab535",
24 + [
25 + nvim,
26 + --headless,
27 + "+\"packadd nvim-treesitter\"",
28 + "+\":TSUpdate",
29 + +q
30 + ]
31 + ],
32 + [
33 + nvim-treesitter-textobjects,
34 + github,
35 + nvim-treesitter/nvim-treesitter-textobjects,
36 + main,
37 + "e0a7b5a6b7f18a5d508d05ca8853273db7bcbe50",
38 + null
39 + ],
40 + [
41 + nvim-ts-autotag,
42 + github,
43 + windwp/nvim-ts-autotag,
44 + main,
45 + "1cca23c9da708047922d3895a71032bc0449c52d",
46 + null
47 + ],
48 + [
49 + oil,
50 + github,
51 + "stevearc/oil.nvim",
52 + master,
53 + "3c2de37accead0240fbe812f5ccdedfe0b973557",
54 + null
55 + ],
56 + [
57 + blink.cmp,
58 + github,
59 + "Saghen/blink.cmp",
60 + main,
61 + "7ceff61595aae682b421a68e208719b1523c7b44",
62 + [
63 + cargo,
64 + build,
65 + --release
66 + ]
67 + ],
68 + [
69 + ivy,
70 + github,
71 + "AdeAttwood/ivy.nvim",
72 + "0.x",
73 + "cfa7e29ae4d955508d4f7f2ef08cc0c51ee745ed",
74 + [
75 + cargo,
76 + build,
77 + --release
78 + ]
79 + ],
80 + [
81 + nvim-surround,
82 + github,
83 + kylechui/nvim-surround,
84 + main,
85 + "9f0cb495f25bff32c936062d85046fbda0c43517",
86 + null
87 + ],
88 + [
89 + neoterm,
90 + github,
91 + "itmecho/neoterm.nvim",
92 + main,
93 + "23a780136892b1128485f20d772a771e528b651b",
94 + null
95 + ],
96 + [
97 + conform,
98 + github,
99 + "stevearc/conform.nvim",
100 + master,
101 + "a203480a350b03092e473bf3001733d547160a73",
102 + null
103 + ],
105 + fidget,
106 + github,
107 + "j-hui/fidget.nvim",
108 + main,
109 + "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f",
110 + null
111 + ],
113 + heirline,
114 + github,
115 + "rebelot/heirline.nvim",
116 + master,
117 + "cc359b628266cb9a84b2d71c883f2b99e16473a0",
118 + null
119 + ],
121 + "mini.splitjoin",
122 + github,
123 + "echasnovski/mini.splitjoin",
124 + main,
125 + "3e92f6764e770ba392325cad3a4497adcada695f",
126 + null
127 + ],
129 + "mini.clue",
130 + github,
131 + "echasnovski/mini.clue",
132 + main,
133 + "983a6c2e6231e94016343ea58921001ab2b74183",
134 + null
135 + ],
137 + "mini.bracketed",
138 + github,
139 + "echasnovski/mini.bracketed",
140 + main,
141 + "daf2bff8172bc84bfb934f765275618f5e7844a8",
142 + null
143 + ],
145 + "mini.align",
146 + github,
147 + "echasnovski/mini.align",
148 + main,
149 + "26111a737494bc39576ad67b52bbc2638ca23553",
150 + null
151 + ],
153 + "mini.cursorword",
154 + github,
155 + "echasnovski/mini.cursorword",
156 + main,
157 + "7d1b38a17834acbbc4feff8e42aedc4ed0c6ff06",
158 + null
159 + ],
161 + "mini.diff",
162 + github,
163 + "echasnovski/mini.diff",
164 + main,
165 + "65c59f9967fec965d8759a88c1baa43147699035",
166 + null
167 + ],
169 + "mini.jump2d",
170 + github,
171 + "echasnovski/mini.jump2d",
172 + main,
173 + "b0963aa2ec80b4b1ed1c7f93d9c969bb3f4b65b6",
174 + null
175 + ],
177 + "mini.operators",
178 + github,
179 + "echasnovski/mini.operators",
180 + main,
181 + "7cb4dc66c51a3d736d347bbc517dc73dc7d28888",
182 + null
183 + ],
185 + "mini.surround",
186 + github,
187 + "echasnovski/mini.splitjoin",
188 + main,
189 + "3e92f6764e770ba392325cad3a4497adcada695f",
190 + null
191 + ],
193 + "mini.move",
194 + github,
195 + "echasnovski/mini.move",
196 + main,
197 + "4caa1c212f5ca3d1633d21cfb184808090ed74b1",
198 + null
199 + ],
201 + "mini.icons",
202 + github,
203 + "echasnovski/mini.icons",
204 + main,
205 + "54686be7d58807906cb2c8c2216e0bf9c044f19a",
206 + null
207 + ],
209 + nvim-autopairs,
210 + github,
211 + windwp/nvim-autopairs,
212 + master,
213 + "b464658e9b880f463b9f7e6ccddd93fb0013f559",
214 + null
215 + ],
217 + nvim-highlight-colors,
218 + github,
219 + "brenoprata10/nvim-highlight-colors",
220 + main,
221 + "e967e2ba13fd4ca731b41d0e5cc1ac2edcd6e25e",
222 + null
223 + ],
225 + lint,
226 + github,
227 + mfussenegger/nvim-lint,
228 + master,
229 + "6b46370d02cd001509a765591a3ffc481b538794",
230 + null
231 + ],
233 + treesj,
234 + github,
235 + Wansmer/treesj,
236 + main,
237 + "03415ac60791d48e120a80d37e080744faf3ac15",
238 + null
239 + ],
241 + virt-column,
242 + github,
243 + "lukas-reineke/virt-column.nvim",
244 + master,
245 + "b87e3e0864211a32724a2ebf3be37e24e9e2fa99",
246 + null
247 + ],
249 + specs,
250 + github,
251 + "cxwx/specs.nvim",
252 + main,
253 + "dd82496f538b688cedf98429f89fef47ecb0625e",
254 + null
255 + ],
257 + glance,
258 + github,
259 + "DNLHC/glance.nvim",
260 + master,
261 + "17ee84e29ac33e7e5d91609f675cee8477586bda",
262 + null
263 + ],
265 + docs-view,
266 + github,
267 + amrbashir/nvim-docs-view,
268 + master,
269 + "365593534e0acd762bfddce6e8313315ffa4fa36",
270 + null
271 + ],
273 + rulebook,
274 + github,
275 + chrisgrieser/nvim-rulebook,
276 + main,
277 + "528857a6e522396c2ded41cb24e694fb3f177429",
278 + null
279 + ],
281 + symbol-usage,
282 + github,
283 + "Wansmer/symbol-usage.nvim",
284 + main,
285 + "0f9b3da014b7e41559b643e7461fcabb2a7dc83a",
286 + null
287 + ],
289 + lazydev,
290 + github,
291 + "folke/lazydev.nvim",
292 + main,
293 + "f59bd14a852ca43db38e3662395354cb2a9b13e0",
294 + null
295 + ],
297 + wezterm-types,
298 + github,
299 + "justinsgithub/wezterm-types",
300 + main,
301 + "1518752906ba3fac0060d9efab6e4d3ec15d4b5a",
302 + null