Merge branch 'trunk' of github.com:bugabinga/dotfiles into trunk
dd9d95ceed12543e33ff54cd0d430f9a1256ddb9
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
- Parent 1: 8cbb8b71af22 · Diff against parent 1
- Parent 2: 07015667ee64 · Showing diff
bugabingas dorkfiles
dd9d95ceed12543e33ff54cd0d430f9a1256ddb9
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
+712 / −671 text lines
+4 / −4 text lines
+12 / −29 text lines
* use in-and-out* get rid of - cmp - lazy - treesj - gomove - devicons - heirline - luasnip - nui - telescope - surround* fix nugu floating highlight border background* indent line bg overwrites visual selection bg* fix bg highlight of treesitter-context* stabilize plugins that are only dependencies. move to own file?* fix markdown rendering in doc popup* replace cmp with vim.lsp.completion when 0.11 comes out+42 / −6 text lines
-- require 'std.dbg'.toggle()require 'std.dbg'.toggle()local start_time = vim.uv.hrtime()local measure_startup_time = vim.api.nvim_create_augroup('measure_startup_time', { clear = true })vim.api.nvim_create_autocmd({ 'VimEnter' }, { group = measure_startup_time, desc = 'Measure startup time of neovim.', once = true, callback = function() local end_time = vim.uv.hrtime() local time_elapsed = end_time - start_time vim.notify(string.format('Neovim started in (%d ms).', time_elapsed / 1e6)) end,})require 'bugabinga.lazy'require 'bugabinga.file_explorer'require 'bugabinga.virtual_column'require 'bugabinga.align'require 'bugabinga.autopairs'require 'bugabinga.autotag'require 'bugabinga.colorizer'require 'bugabinga.cursorword'require 'bugabinga.devicons'require 'bugabinga.diff'require 'bugabinga.format'require 'bugabinga.jump2d'require 'bugabinga.lint'require 'bugabinga.move'require 'bugabinga.navigation'require 'bugabinga.notifications'require 'bugabinga.operators'require 'bugabinga.specs'require 'bugabinga.splitjoin'require 'bugabinga.statusbar'require 'bugabinga.surround'require 'bugabinga.textobjects'require 'bugabinga.key_preview'require 'bugabinga.incubator'new file mode 100644+60 / −0 text lines
local puk = require 'std.puk'local map = require 'std.map'local icon = require 'std.icon'local oil = puk 'oil'oil.setup { -- default_file_explorer = true, -- Set to true to watch the filesystem for changes and reload oil -- experimental_watch_for_changes = true, skip_confirm_for_simple_edits = true, prompt_save_on_select_new_entry = false, delete_to_trash = true, columns = { 'icon' }, win_options = { cursorline = true, }, keymaps = { ['q'] = 'actions.close', ['<C-v>'] = 'actions.select_vsplit', ['<C-s>'] = 'actions.select_split', ['`'] = 'actions.tcd', ['~'] = '<cmd>edit $HOME<CR>', ['<F7>'] = 'actions.open_terminal', ['gd'] = { desc = 'Toggle detail view', callback = function() local oil = require 'oil' local config = require 'oil.config' if #config.columns == 1 then oil.set_columns { 'icon', 'permissions', 'size', { 'mtime', format = '%d/%m/%y %T' } } else oil.set_columns { 'icon' } end end, }, }, float = { max_width = 69, min_width = 69, border = vim.g.border_style, padding = 2, }, -- Configuration for the floating keymaps help window keymaps_help = { border = vim.g.border_style, }, view_options = { is_always_hidden = function(name, bufnr) return name == '..' end, show_hidden = true, },}map.normal { description = 'Open parent directory in buffer.', category = 'files', keys = '-', command = oil.open,}new file mode 100644+51 / −0 text lines
local puk = require 'std.puk'puk.defer 'mini.clue' (function(clue) clue.setup { triggers = { -- Leader triggers { mode = 'n', keys = '<Leader>' }, { mode = 'x', keys = '<Leader>' }, -- Built-in completion { mode = 'i', keys = '<C-x>' }, -- `g` key { mode = 'n', keys = 'g' }, { mode = 'x', keys = 'g' }, -- Marks { mode = 'n', keys = "'" }, { mode = 'n', keys = '`' }, { mode = 'x', keys = "'" }, { mode = 'x', keys = '`' }, -- Registers { mode = 'n', keys = '"' }, { mode = 'x', keys = '"' }, { mode = 'i', keys = '<C-r>' }, { mode = 'c', keys = '<C-r>' }, -- Window commands { mode = 'n', keys = '<C-w>' }, -- `z` key { mode = 'n', keys = 'z' }, { mode = 'x', keys = 'z' }, }, clues = { -- Enhance this by adding descriptions for <Leader> mapping groups { mode = 'n', keys = '<Leader>t', desc = '+Toggle' }, { mode = 'n', keys = '<Leader>l', desc = '+LSP' }, { mode = 'n', keys = '<Leader>lp', desc = '+Peek' }, { mode = 'n', keys = '<Leader>r', desc = '+Rules' }, clue.gen_clues.builtin_completion(), clue.gen_clues.g(), clue.gen_clues.marks(), clue.gen_clues.registers(), clue.gen_clues.windows(), clue.gen_clues.z(), }, }end)+0 / −4 text lines
+0 / −11 text lines
+82 / −387 text lines
local dbg = require 'std.dbg'local icon = require 'std.icon'local defer = require 'std.defer'local map = require 'std.map'local auto = require 'std.auto'local table = require 'std.table'local ignored = require 'std.ignored'local user_command = require 'std.user_command'local lsp_client_configs = require 'bugabinga.lsp.clients'local localrc = require 'std.localrc'local _ = {}local token_update = function ( lsp_client ) local token = lsp_client.data.token local buffer = lsp_client.buffer local client_id = lsp_client.data.client_id local mutable_variable_highlight = 'MutableVariable' if token.type == 'variable' and not token.modifiers.readonly then vim.lsp.semantic_tokens.highlight_token( token, buffer, client_id, mutable_variable_highlight ) end --TODO: find more use cases for semantic tokens --* global variables --* functions with side effects --* closures that capture somethinglocal lsp_start = function ( file_type_event ) dbg.print 'trying to start lsp' local match = file_type_event.match dbg.print( 'filetypes to ignore', ignored.filetypes, 'current filetype', match ) if vim.iter( ignored.filetypes ):find( match ) then return end local bufnr = file_type_event.buf local buftype = vim.api.nvim_get_option_value( 'buftype', { buf = bufnr } ) dbg.print( 'buftypes to ignore', ignored.buftypes, 'current buftype', buftype ) if vim.iter( ignored.buftypes ):find( buftype ) then return end local buffer_path = vim.api.nvim_buf_get_name( bufnr ) dbg.print( string.format( 'searching lsp client for: match: %s, buffer: %s, path: %s', match, bufnr, buffer_path ) ) local potential_client_configs = vim.iter( lsp_client_configs ) :map( function ( config ) vim.validate { ['config'] = { config, 'table' }, ['config.name'] = { config.name, 'string' }, ['config.filetypes'] = { config.filetypes, { 'string', 'table' } }, ['config.command'] = { config.command, { 'string', 'table' } }, ['config.environment'] = { config.environment, 'table', true }, ['config.root_dir'] = { config.root_dir, 'function', 'string' }, ['config.single_file_support'] = { config.single_file_support, 'boolean', true }, ['config.settings'] = { config.settings, 'table', true }, ['config.workspaces'] = { config.workspaces, 'boolean', true }, ['config.before_init'] = { config.before_init, { 'function', 'table' }, true }, ['config.init_options'] = { config.init_options, 'table', true }, ['config.capabilities'] = { config.capabilities, 'table', true }, ['config.custom_start'] = { config.custom_start, 'function', true }, } -- normalize scalar values to its vector alternative for easier processing later on -- this mutates the lsp client configs! careful! config.command = type( config.command ) == 'string' and { expand_command( config.command ) } or expand_command( config.command ) config.environment = config.environment or {} config.filetypes = type( config.filetypes ) == 'string' and { config.filetypes } or config.filetypes config.single_file_support = config.single_file_support == nil and false or config.single_file_support config.workspaces = config.workspaces == nil and false or config.workspaces config.capabilities = config.capabilities or {} config.init_options = config.init_options or {} return config end ) :filter( function ( config ) return vim.iter( config.filetypes ):find( match ) end ) :totable() dbg.print( 'POTENTIAL CLIENTS', vim.iter( potential_client_configs ):map( function ( config ) return { name = config.name, command = config.command, } end ) :totable() ) if table.is_empty( potential_client_configs ) then dbg.print( 'found no lsp client for', buffer_path ) return end --NOTE: this is super kool but has the limitation, that only lsp clients -- configured via my special lsp module are affected. local project_local_lsp_settings = localrc( '.lsp.settings.lua', 'table' ) or {} local project_local_workspace_folders = localrc( '.lsp.workspace_folders.lua', 'table' ) or {} -- expand relative workspace paths into lsp.workspaceFolders (name + uri) for lsp, folders in pairs( project_local_workspace_folders ) do for idx, path in ipairs( folders ) do local cwd = vim.uv.cwd() local abs_path = vim.fs.normalize( vim.fs.joinpath( cwd, path ) ) local exists = vim.uv.fs_stat( abs_path ) if not exists or exists.type ~= 'directory' then vim.error( 'the project local workspace folder ' .. abs_path .. ' does not exist or is not a directory.' ) end project_local_workspace_folders[lsp][idx] = { uri = 'file://' .. abs_path, name = path } end end dbg.print( 'patched project local workspace folders', project_local_workspace_folders ) for _, config in ipairs( potential_client_configs ) do local path = type( config.command ) == 'table' and config.command[1] or config.command if vim.fn.executable( path ) ~= 1 then vim.notify( 'The LSP ' .. config.name .. ' does not seem to be installed!' ) break endlocal language_servers = { lua_ls = { root_dir = project.find_lua_project_root, settings = { Lua = { hint = { enable = true, setType = true, }, telemetry = { enable = false, }, }, }, }, -- TODO: take some config from clients/ int here jdtls = { root_dir = project.find_java_project_root, }, zls = { root_dir = project.find_zig_project_root, }, ziggy = { root_dir = project.find_vcs_project_root, }, ziggy_schema = { root_dir = project.find_vcs_project_root, }, asm_lsp = { root_dir = project.find_vcs_project_root, }, clangd = { root_dir = project.find_vcs_project_root, }, denols = { root_dir = project.find_vcs_project_root, }, dotls = { root_dir = project.find_vcs_project_root, }, docker_compose_language_service = { root_dir = project.find_vcs_project_root, }, dockerls = { root_dir = project.find_vcs_project_root, }, ast_grep = { root_dir = project.find_vcs_project_root, }, cssls = { root_dir = project.find_vcs_project_root, }, css_variables = { root_dir = project.find_vcs_project_root, }, emmet_language_server = { root_dir = project.find_vcs_project_root, }, gopls = { root_dir = project.find_vcs_project_root, }, gradle_ls = { root_dir = project.find_vcs_project_root, }, harper_ls = { root_dir = project.find_vcs_project_root, }, html = { root_dir = project.find_vcs_project_root, }, htmx = { root_dir = project.find_vcs_project_root, }, hyprls = { root_dir = project.find_vcs_project_root, }, jsonls = { root_dir = project.find_vcs_project_root, }, lemminx = { root_dir = project.find_vcs_project_root, }, lsp_ai = { root_dir = project.find_vcs_project_root, }, ltex = { root_dir = project.find_vcs_project_root, }, marksman = { root_dir = project.find_vcs_project_root, }, markdown_oxide = { root_dir = project.find_vcs_project_root, }, nil_ls = { root_dir = project.find_vcs_project_root, }, nixd = { root_dir = project.find_vcs_project_root, }, nushell = { root_dir = project.find_vcs_project_root, }, ocamllsp = { root_dir = project.find_vcs_project_root, }, protols = { root_dir = project.find_vcs_project_root, }, roc_ls = { root_dir = project.find_vcs_project_root, }, rust_analyzer = { root_dir = project.find_vcs_project_root, }, statix = { root_dir = project.find_vcs_project_root, }, superhtml = { root_dir = project.find_vcs_project_root, }, tabby_ml = { root_dir = project.find_vcs_project_root, }, taplo = { root_dir = project.find_vcs_project_root, }, ts_ls = { root_dir = project.find_vcs_project_root, }, zk = { root_dir = project.find_vcs_project_root, },} capabilities = table.extend( 'force', capabilities, config.capabilities ) local settings = config.settings local settings_override = project_local_lsp_settings[config.name] if settings_override then dbg.print( 'overriding settings with project local settings', settings, settings_override ) settings = vim.tbl_deep_extend( 'force', settings, settings_override ) end local root_dir = type( config.root_dir ) == 'string' and config.root_dir or config.root_dir( buffer_path ) local root_workspace = root_dir and { uri = 'file://' .. root_dir, name = root_dir } or nil local workspace_folders = root_workspace and { root_workspace } or nil local workspace_folders_local = project_local_workspace_folders[config.name] if not workspace_folders_local then dbg.print( 'no local workspace folders found for ' .. config.name ) end if workspace_folders_local and config.workspaces then dbg.print( 'setting workspace folders to project local workspace folders', workspace_folders_local ) workspace_folders = workspace_folders and vim.tbl_deep_extend( 'force', workspace_folders, workspace_folders_local ) or workspace_folders_local end dbg.print( 'starting command:', config.command ) local start_config = { cmd = config.command, cmd_cwd = root_dir, -- cmd_env = config.environment, detached = false, -- do i want this? root_dir = root_dir, workspace_folders = workspace_folders, capabilities = capabilities, -- handlers = vim.lsp.handlers, settings = settings, -- commands = nil, -- what is this? init_options = config.init_options, name = config.name, -- get_language_id = nil, -- offset_encoding = nil, on_error = function ( code, ... ) vim.print( 'LSP ERROR', code, ... ) end, before_init = config.before_init, -- on_init = nil, -- should i send workspace/didChangeConfiguration here? on_exit = function ( code, signal, client_id ) dbg.print( 'LSP CLIENT EXIT', code, signal, client_id ) end, on_attach = function ( client, attach_bufnr ) dbg.print( 'LSP CLIENT ATTACH', client, attach_bufnr ) end, trace = dbg.get() and 'on' or 'off', flags = { allow_incremental_sync = true, debounce_text_changes = 250, exit_timeout = 200 }, } local lsp_starter = config.custom_start or vim.lsp.start dbg.print( 'starting lsp', start_config.name, root_dir ) lsp_starter( start_config, { bufnr = bufnr, -- TODO: reuse if workspaces -- local supported = vim.tbl_get(client, 'server_capabilities', 'workspace', 'workspaceFolders', 'supported') reuse_client = function ( existing_client, new_config ) dbg.print( 'lsp reuse client', existing_client.name, existing_client.workspace_folders, new_config.name, new_config.root_dir ) --TODO lsps with single file or worksopaces support do not need smame root dir. instead add_workspace_folder local same_name = existing_client.name == new_config.name local new_root_raw = new_config.root_dir or nil local existing_root_raw = existing_client.workspace_folders and #existing_client.workspace_folders >= 1 and existing_client.workspace_folders[1].name or nil if not (new_root_raw and existing_root_raw) then return false end local new_root = vim.fs.normalize( new_root_raw ) local existing_root = vim.fs.normalize( existing_root_raw ) local same_root = new_root == existing_root local reuse = same_name and same_root dbg.print( 'reusing lsp client?', reuse ) return reuse end, } ) dbg.print( 'STARTING LSP CLIENT', config.name ) config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities) capabilities = table.extend('force', capabilities, config.capabilities) local settings = config.settings or {} local settings_override = local_settings(server) or {} config.settings = table.extend('force', settings, settings_override) lspconfig[server].setup(config)-- FIXME: move to own file with LspAttach instead, so that those settings are-- applied to all LSPs, not only those managed by my configs.local lsp_attach = function ( args )local lsp_attach = function(args) local client = vim.lsp.get_client_by_id( client_id ) local client = vim.lsp.get_client_by_id(client_id) dbg.print( client.server_capabilities ) if client.server_capabilities.definitionProvider then vim.bo[bufnr].tagfunc = 'v:lua.vim.lsp.tagfunc' end if client.server_capabilities.documentFormattingProvider then vim.bo[bufnr].formatexpr = 'v:lua.vim.lsp.formatexpr' end if client.server_capabilities.completionProvider then vim.bo[bufnr].omnifunc = 'v:lua.vim.lsp.omnifunc' end vim.lsp.completion.enable(true, client_id, bufnr) map.normal { description = 'Show hover documentation above cursor.', category = 'lsp', buffer = bufnr, keys = { 'K', '<leader>lk' }, command = vim.lsp.buf.hover, } map.insert { description = 'Show signature help under cursor.', category = 'lsp', buffer = bufnr, keys = { '<C-h>' }, command = vim.lsp.buf.signature_help, } map.normal { description = 'Show available code actions on current line.', category = 'lsp', buffer = bufnr, keys = '<leader>la', command = vim.lsp.buf.code_action, } map.normal { description = 'Goto to definition of symbol under cursor.', category = 'lsp', buffer = bufnr, keys = '<leader>ld', command = vim.lsp.buf.definition, } map.normal { description = 'Show implementations of symbol under cursor.', category = 'lsp', buffer = bufnr, keys = '<leader>li', command = vim.lsp.buf.implementation, } map.normal { description = 'Show incoming calls of symbol under cursor.', category = 'lsp', buffer = bufnr, keys = '<leader>lc', command = vim.lsp.buf.incoming_calls, } map.normal { description = 'Show outgoing calls of symbol under cursor.', category = 'lsp', buffer = bufnr, keys = '<leader>lC', command = vim.lsp.buf.outgoing_calls, } map.normal { description = 'Show references of symbol under cursor.', category = 'lsp', buffer = bufnr, keys = '<leader>ln', command = vim.lsp.buf.references, } map.normal { description = 'Rename symbol under cursor.', category = 'lsp', buffer = bufnr, keys = { '<f2>', '<leader>lr' }, command = vim.lsp.buf.rename, } { description = 'Start or reuse LSP client', events = 'FileType', command = lsp_start, }, { description = 'Hook: LSP client attached to buffer', events = 'LspAttach', command = lsp_attach, }, { description = 'Semantic Tokens from the LSP', events = 'LspTokenUpdate', command = token_update, },local lsp_info = function ( command ) local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0 } local active_clients = vim.lsp.get_clients( all_or_current ) local infos = vim.iter( active_clients ) :map( function ( client ) local name = client.name local config = vim.iter( lsp_client_configs ):find( function ( config ) return config.name == name end ) assert( config, ('How did we not find a config for %s ?!?!'):format( name ) ) local full_cmd = table.deep_copy( client.config.cmd ) full_cmd[1] = vim.fn.exepath( full_cmd[1] ) local basic = { id = client.id, name = name, cmd = table.concat( full_cmd, ' ' ), workspace_folders = vim.iter( client.workspace_folders ):map( function ( w ) return vim.fs.normalize( w.name ) end ) :totable(), filetypes = table.concat( config.filetypes, ', ' ), single_file_support = config.single_file_support, workspaces = config.workspaces, } return basic end ) :totable() vim.print( vim.inspect( infos ) )endlocal lsp_info_extended = function ( command ) local all_or_current = command.args and command.args == 'all' and {} or { bufnr = 0 } local active_clients = vim.lsp.get_clients( all_or_current ) vim.print( vim.inspect( active_clients ) )enduser_command.LspInfo'Shows basic information about running LSP clients.' { nargs = '?', complete = function () return { 'all' } end } ( lsp_info )user_command.LspInfoExtended'Shows detailed information about running LSP clients.' { nargs = '?', complete = function () return { 'all' } end } ( lsp_info_extended )-- TODO: LspStart-- TODO: LspStop-- TODO: LspRestart ? Maybe good after changing project local settings?+89 / −142 text lines
return { ------------------------------------------------------------------------------- --- does not yet restore well with session --- cannot navigate with C-w inside the DocsView --- it has a manual update mode, but which key to bind it to? { 'amrbashir/nvim-docs-view', keys = { { '<leader>tk', '<cmd>DocsViewToggle<cr>', mode = { 'n' }, desc = 'Toggle stable documentation panel.', },---------------------------------------------------------------------------------- does not yet restore well with session--- cannot navigate with C-w inside the DocsView--- it has a manual update mode, but which key to bind it to?puk.defer 'docs-view' (function(docsview) docsview.setup { position = 'right', width = 42, } map.normal { description = 'Toggle stable documentation panel.', keys = '<leader>tk', command = '<cmd>DocsViewToggle<cr>', }end)---------------------------------------------------------------------------------- this is pretty great! i just need better binds and tell which key about thempuk.defer 'rulebook' (function(rulebook) rulebook.setup () map.normal { description = 'ignore rule', category = 'lint', keys = '<leader>ri', command = rulebook.ignoreRule, } map.normal { description = 'lookup rule', category = 'lint', keys = '<leader>rl', command = rulebook.lookupRule, } map.normal { description = 'yank diagnostic code', category = 'lint', keys = '<leader>ry', command = rulebook.yankDiagnosticCode, } map.normal { description = 'supress formatter', category = 'lint', keys = '<leader>rf', command = rulebook.suppressFormatter, }end)---------------------------------------------------------------------------------- this plugin has some sick visual text formatting chops. check them out some time.puk.defer 'symbol-usage'(function(symbolusage) symbolusage.setup { hi = { link = 'LineNr' }, vt_position = 'end_of_line', request_pending_text = false, disable = { filetypes = ignored.filetypes, cmd = 'DocsViewToggle', opts = { position = 'right', width = 42, }, enabled = FUCK_STABILITY, }, ------------------------------------------------------------------------------- --- look into demicolon.nvim for ,; repition { 'mawkler/refjump.nvim', dependencies = { }, keys = { ']r', '[r' }, opts = {}, enabled = FUCK_STABILITY, }, ------------------------------------------------------------------------------- --- this is pretty great! i just need better binds and tell which key about them { 'chrisgrieser/nvim-rulebook', keys = { { '<leader>ri', function () require 'rulebook'.ignoreRule() end }, { '<leader>rl', function () require 'rulebook'.lookupRule() end }, { '<leader>ry', function () require 'rulebook'.yankDiagnosticCode() end }, { '<leader>sf', function () require 'rulebook'.suppressFormatter() end, mode = { 'n', 'x' } }, }, enabled = FUCK_STABILITY, }, ------------------------------------------------------------------------------- --- this plugin has some sick visual text formatting chops. check them out some time. { 'Wansmer/symbol-usage.nvim', event = 'LspAttach', opts = { hi = { link = 'LineNr' }, vt_position = 'end_of_line', request_pending_text = false, disable = { filetypes = ignored.filetypes, }, log = { enabled = dbg.get() }, }, enabled = FUCK_STABILITY, }, ------------------------------------------------------------------------------- --- Pretty NICE! --- fix highlights to match nugu. { 'dnlhc/glance.nvim', event = 'LspAttach', keys = { { '<Leader>gd', '<cmd>Glance definitions<cr>', { silent = true }, desc = 'Peek definitions', mode = 'n' }, { '<Leader>gr', '<cmd>Glance references<cr>', { silent = true }, desc = 'Peek refernces', mode = 'n' }, { '<Leader>gy', '<cmd>Glance type_definitions<cr>', { silent = true }, desc = 'Peek type definitions', mode = 'n' }, { '<Leader>gm', '<cmd>Glance implementations<cr>', { silent = true }, desc = 'Peek implementations', mode = 'n' }, }, config = true, enabled = FUCK_STABILITY, }, ------------------------------------------------------------------------------- { 'emmanueltouzery/decisive.nvim', config = function () require 'decisive'.setup {} end, ft = { 'csv' }, keys = { { '<leader>cca', ":lua require('decisive').align_csv({})<cr>", { silent = true }, desc = 'Align CSV', mode = 'n' }, { '<leader>ccA', ":lua require('decisive').align_csv_clear({})<cr>", { silent = true }, desc = 'Align CSV clear', mode = 'n' }, { '[c', ":lua require('decisive').align_csv_prev_col()<cr>", { silent = true }, desc = 'Align CSV prev col', mode = 'n' }, { ']c', ":lua require('decisive').align_csv_next_col()<cr>", { silent = true }, desc = 'Align CSV next col', mode = 'n' }, }, enabled = FUCK_STABILITY, }, ------------------------------------------------------------------------------- --- fix nugu highlights (also snippet highlights) --- configure with custom snippets? { 'saghen/blink.cmp', lazy = false, -- lazy loading handled internally -- use a release tag to download pre-built binaries version = 'v0.*', ---@module 'blink.cmp' ---@type blink.cmp.Config opts = { -- 'default' for mappings similar to built-in completion -- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate) -- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept -- see the "default configuration" section below for full documentation on how to define -- your own keymap. keymap = { preset = 'default' }, highlight = { -- sets the fallback highlight groups to nvim-cmp's highlight groups -- useful for when your theme doesn't support blink.cmp -- will be removed in a future release, assuming themes add support use_nvim_cmp_as_default = true, }, -- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font' -- adjusts spacing to ensure icons are aligned nerd_font_variant = 'normal', -- default list of enabled providers defined so that you can extend it -- elsewhere in your config, without redefining it, via `opts_extend` sources = { completion = { enabled_providers = { 'lsp', 'path', 'snippets', 'buffer' }, }, }, -- experimental auto-brackets support accept = { auto_brackets = { enabled = true } }, -- experimental signature help support trigger = { signature_help = { enabled = true } }, }, -- allows extending the enabled_providers array elsewhere in your config -- without having to redefine it opts_extend = { 'sources.completion.enabled_providers' }, }, -------------------------------------------------------------------------------} log = { enabled = dbg.get() }, }end)---------------------------------------------------------------------------------- Pretty NICE!--- fix highlights to match nugu.puk.defer 'glance' (function(glance) glance.setup() map.normal { description = 'peek definitions', category = 'lsp', keys = '<Leader>lpd', command = '<cmd>Glance definitions<cr>', } map.normal { description = 'Peek references', category = 'lsp', keys = '<Leader>lpr', command = '<cmd>Glance references<cr>', } map.normal { description = 'Peek type definitions', category = 'lsp', keys = '<Leader>lpt', command = '<cmd>Glance type_definitions<cr>', } map.normal { description = 'Peek implementations', keys = '<Leader>lpi', command = '<cmd>Glance implementations<cr>', }end)-------------------------------------------------------------------------------new file mode 100644+26 / −0 text lines
local puk = require 'std.puk'local map = require 'std.map'local auto = require 'std.auto'local treesj = puk 'treesj'local splitjoin = puk 'mini.splitjoin'treesj.setup { use_default_keymaps = false, max_join_length = 360,}splitjoin.setup()map.normal { description = 'Toggle Tree Join/Split', category = 'editing', keys = '<c-j>', command = function() local langs = require 'treesj.langs'['presets'] if langs[vim.bo.filetype] then treesj.toggle { split = { recursive = false } } else splitjoin.toggle() end end,}+44 / −49 text lines
local debug = require 'std.dbg'local expand = function ( path ) return vim.fn.fnamemodify( path, ':p' ) endlocal expand = function(path) return vim.fn.fnamemodify(path, ':p') end---@param stop string? The last directory on the path to root, when to stop searching. if `nil`, the users home---@return string? # Directory, that contains the `markers` and lies on the path from `path` to `stop`. if not exists( stop ) then error( ('the stop directory %s does not exist!'):format( stop ) ) end if not exists(stop) then error(('the stop directory %s does not exist!'):format(stop)) end local cache_hit = cache_get( path, markers, stop ) local cache_hit = cache_get(path, markers, stop) debug.print( 'CACHE HIT', cache_hit ) debug.print( ('searching for markers reached the max traversal count for path %s !'):format( path ) ) if debug.get() then score.likelyhood = likelyhood end debug.print( 'found project root', project_root, directory_scores )---@return string? # The project root of the current buffer, or `nil`, if none could be determined.local function find_project_root( path, markers )local function find_project_root(path, markers) return find_root( path, join( default_markers, markers ) ) return find_root(path, join(default_markers, markers)) local cargo_crate_dir = find_project_root( path, markers ) local cargo_crate_dir = find_project_root(path, markers) vim.fs.joinpath( cargo_crate_dir, 'Cargo.toml' ), vim.fs.joinpath(cargo_crate_dir, 'Cargo.toml'), local result = vim.system( cmd, { text = true, } ):wait() local result = vim.system(cmd, { text = true, }):wait() cargo_workspace_root = vim.fs.normalize( json['workspace_root'] ) cargo_workspace_root = vim.fs.normalize(json['workspace_root'])local find_root_by_filetype = function ( path, filetype )local find_root_by_filetype = function(path, filetype)+302 / −39 text lines
# vim: ft=nu [name, source, repo, commit, build]; ## IMPORTANT ONES [nvim-treesitter, github, 'nvim-treesitter/nvim-treesitter', "fc940eaf106981a92829518e977e46ad4f306472", null], [nvim-treesitter-textobjects, github, 'nvim-treesitter/nvim-treesitter-textobjects', "e0a7b5a6b7f18a5d508d05ca8853273db7bcbe50", null], [nvim-ts-autotag, github, 'windwp/nvim-ts-autotag', "e239a560f338be31337e7abc3ee42515daf23f5e", null], ["oil", github, 'stevearc/oil.nvim', "3c2de37accead0240fbe812f5ccdedfe0b973557", null], [blink, github, 'Saghen/blink.cmp', '180be7ba574033baa30fa8af0db4f59db7353584', [cargo build '--release'] ], [ivy, github, 'AdeAttwood/ivy.nvim', 'cfa7e29ae4d955508d4f7f2ef08cc0c51ee745ed', [cargo build '--release'] ], [nvim-surround, github, 'kylechui/nvim-surround', 'dca2e998ff26681ee422b92c6ed39b3d2908d8a9', null ], [neoterm, github, 'itmecho/neoterm.nvim', '23a780136892b1128485f20d772a771e528b651b', null ], ["conform", github, 'stevearc/conform.nvim', "6239d9986f51ca93ded99ecdb1af0e287eabb651", null], ["fidget", github, 'j-hui/fidget.nvim', "ef99df04a1c53a453602421bc0f756997edc8289", null], ["heirline", github, "rebelot/heirline.nvim", "cc359b628266cb9a84b2d71c883f2b99e16473a0", null], ["mini.bracketed", github, 'echasnovski/mini.bracketed', "833d66df6e0588222312a963780c6ec42ed7437d", null], ["mini.align", github, 'echasnovski/mini.align', "26111a737494bc39576ad67b52bbc2638ca23553", null], ["mini.cursorword",github, "echasnovski/mini.cursorword", "7d1b38a17834acbbc4feff8e42aedc4ed0c6ff06", null], ["mini.diff",github, "echasnovski/mini.diff", "24d46798be8a358d38d3adc92c7ebcbb2d6f67e0", null], ["mini.jump2d",github, "echasnovski/mini.jump2d", "b0963aa2ec80b4b1ed1c7f93d9c969bb3f4b65b6", null], ["mini.operators",github, "echasnovski/mini.operators", "35b12f54bd5acb860f4297fd6d12fd07b1b065e2", null], ['mini.move', github, 'echasnovski/mini.move', "4caa1c212f5ca3d1633d21cfb184808090ed74b1", null], ['mini.icons', github, 'echasnovski/mini.icons', "54686be7d58807906cb2c8c2216e0bf9c044f19a", null], [nvim-autopairs, github, 'windwp/nvim-autopairs', "f158dcb865c36f72c92358f87787dab2c272eaf3", null], [nvim-highlight-colors, github, 'brenoprata10/nvim-highlight-colors', "e967e2ba13fd4ca731b41d0e5cc1ac2edcd6e25e", null], [lint, github, 'mfussenegger/nvim-lint', "968a35d54b3a4c1ce66609cf80b14d4ae44fe77f", null], [treesj, github, 'Wansmer/treesj', "03415ac60791d48e120a80d37e080744faf3ac15", null], ["virt-column", github, 'lukas-reineke/virt-column.nvim', "b87e3e0864211a32724a2ebf3be37e24e9e2fa99", null], ["specs", github, 'edluffy/specs.nvim', "2743e412bbe21c9d73954c403d01e8de7377890d", null], ## INLINING CANDIDATES ## INCUBATOR ["decisive", github, 'emmanueltouzery/decisive.nvim', "a7251adebccbc9c899cff39a524b20d06e2b78b5", null], ["glance", github, 'DNLHC/glance.nvim', "17ee84e29ac33e7e5d91609f675cee8477586bda", null], ["iswap", github, "mizlan/iswap.nvim", "e02cc91f2a8feb5c5a595767d208c54b6e3258ec", null], [docs-view, github, 'amrbashir/nvim-docs-view',"365593534e0acd762bfddce6e8313315ffa4fa36", null], [rulebook, github, 'chrisgrieser/nvim-rulebook', "528857a6e522396c2ded41cb24e694fb3f177429", null], ["symbol-usage", github, 'Wansmer/symbol-usage.nvim', "0f9b3da014b7e41559b643e7461fcabb2a7dc83a", null], [ name, source, repo, branch, commit, build ]; [ lspconfig, github, neovim/nvim-lspconfig, main, "1aa9f36b6d542dafc0b4a38c48969d036003b00a", null ], [ nvim-treesitter, github, nvim-treesitter/nvim-treesitter, main, "c4a22ce846d8c15cfe86469ef557d5b9860ab535", [ nvim, --headless, "+\"packadd nvim-treesitter\"", "+\":TSUpdate", +q ] ], [ nvim-treesitter-textobjects, github, nvim-treesitter/nvim-treesitter-textobjects, main, "e0a7b5a6b7f18a5d508d05ca8853273db7bcbe50", null ], [ nvim-ts-autotag, github, windwp/nvim-ts-autotag, main, "1cca23c9da708047922d3895a71032bc0449c52d", null ], [ oil, github, "stevearc/oil.nvim", master, "3c2de37accead0240fbe812f5ccdedfe0b973557", null ], [ blink.cmp, github, "Saghen/blink.cmp", main, "7ceff61595aae682b421a68e208719b1523c7b44", [ cargo, build, --release ] ], [ ivy, github, "AdeAttwood/ivy.nvim", "0.x", "cfa7e29ae4d955508d4f7f2ef08cc0c51ee745ed", [ cargo, build, --release ] ], [ nvim-surround, github, kylechui/nvim-surround, main, "9f0cb495f25bff32c936062d85046fbda0c43517", null ], [ neoterm, github, "itmecho/neoterm.nvim", main, "23a780136892b1128485f20d772a771e528b651b", null ], [ conform, github, "stevearc/conform.nvim", master, "a203480a350b03092e473bf3001733d547160a73", null ], [ fidget, github, "j-hui/fidget.nvim", main, "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f", null ], [ heirline, github, "rebelot/heirline.nvim", master, "cc359b628266cb9a84b2d71c883f2b99e16473a0", null ], [ "mini.splitjoin", github, "echasnovski/mini.splitjoin", main, "3e92f6764e770ba392325cad3a4497adcada695f", null ], [ "mini.clue", github, "echasnovski/mini.clue", main, "983a6c2e6231e94016343ea58921001ab2b74183", null ], [ "mini.bracketed", github, "echasnovski/mini.bracketed", main, "daf2bff8172bc84bfb934f765275618f5e7844a8", null ], [ "mini.align", github, "echasnovski/mini.align", main, "26111a737494bc39576ad67b52bbc2638ca23553", null ], [ "mini.cursorword", github, "echasnovski/mini.cursorword", main, "7d1b38a17834acbbc4feff8e42aedc4ed0c6ff06", null ], [ "mini.diff", github, "echasnovski/mini.diff", main, "65c59f9967fec965d8759a88c1baa43147699035", null ], [ "mini.jump2d", github, "echasnovski/mini.jump2d", main, "b0963aa2ec80b4b1ed1c7f93d9c969bb3f4b65b6", null ], [ "mini.operators", github, "echasnovski/mini.operators", main, "7cb4dc66c51a3d736d347bbc517dc73dc7d28888", null ], [ "mini.surround", github, "echasnovski/mini.splitjoin", main, "3e92f6764e770ba392325cad3a4497adcada695f", null ], [ "mini.move", github, "echasnovski/mini.move", main, "4caa1c212f5ca3d1633d21cfb184808090ed74b1", null ], [ "mini.icons", github, "echasnovski/mini.icons", main, "54686be7d58807906cb2c8c2216e0bf9c044f19a", null ], [ nvim-autopairs, github, windwp/nvim-autopairs, master, "b464658e9b880f463b9f7e6ccddd93fb0013f559", null ], [ nvim-highlight-colors, github, "brenoprata10/nvim-highlight-colors", main, "e967e2ba13fd4ca731b41d0e5cc1ac2edcd6e25e", null ], [ lint, github, mfussenegger/nvim-lint, master, "6b46370d02cd001509a765591a3ffc481b538794", null ], [ treesj, github, Wansmer/treesj, main, "03415ac60791d48e120a80d37e080744faf3ac15", null ], [ virt-column, github, "lukas-reineke/virt-column.nvim", master, "b87e3e0864211a32724a2ebf3be37e24e9e2fa99", null ], [ specs, github, "cxwx/specs.nvim", main, "dd82496f538b688cedf98429f89fef47ecb0625e", null ], [ glance, github, "DNLHC/glance.nvim", master, "17ee84e29ac33e7e5d91609f675cee8477586bda", null ], [ docs-view, github, amrbashir/nvim-docs-view, master, "365593534e0acd762bfddce6e8313315ffa4fa36", null ], [ rulebook, github, chrisgrieser/nvim-rulebook, main, "528857a6e522396c2ded41cb24e694fb3f177429", null ], [ symbol-usage, github, "Wansmer/symbol-usage.nvim", main, "0f9b3da014b7e41559b643e7461fcabb2a7dc83a", null ], [ lazydev, github, "folke/lazydev.nvim", main, "f59bd14a852ca43db38e3662395354cb2a9b13e0", null ], [ wezterm-types, github, "justinsgithub/wezterm-types", main, "1518752906ba3fac0060d9efab6e4d3ec15d4b5a", null ]