Merge branch 'trunk' of github.com:bugabinga/dotfiles into trunk
6fe5949cc2acc298d8c5f64353dcae30ddf399e8
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
- Parent 1: 4b50618500f4 · Diff against parent 1
- Parent 2: d19f18dc4784 · Showing diff
bugabingas dorkfiles
6fe5949cc2acc298d8c5f64353dcae30ddf399e8
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
+987 / −956 text lines · 1 binary (striped old/new sizes in 64-byte units, not churn) · lines and sizes scale separately
+1 / −1 text lines
+12 / −12 text lines
"actions-preview.nvim": { "branch": "master", "commit": "5072b1b1065a6b22bdd46b5c21780a91d6a08071" }, "auto-dark-mode.nvim": { "branch": "master", "commit": "e328dc463d238cb7d690fb4daf068eba732a5a14" }, "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" }, "colorizer.nvim": { "branch": "master", "commit": "107719885290366c893e1c1c58b7474cbeabfef6" }, "conform.nvim": { "branch": "master", "commit": "820eec990d5f332d30cf939954c8672a43a0459e" }, "conform.nvim": { "branch": "master", "commit": "a6965ac128eba75537ec2bc5ddd5d5e357062bdc" }, "gitsigns.nvim": { "branch": "main", "commit": "6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" }, "gitsigns.nvim": { "branch": "main", "commit": "52f8da33cc0cadbf1164c4a91c8bfd6895533d67" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "neogen": { "branch": "main", "commit": "0daffcec249bf42275e322361fe55b89a05ff278" }, "neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" }, "nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" }, "nvim-dap": { "branch": "master", "commit": "405df1dcc2e395ab5173a9c3d00e03942c023074" }, "nvim-dap": { "branch": "master", "commit": "6ae8a14828b0f3bff1721a35a1dfd604b6a933bb" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "3e8e207513e6ef520894950acd76b79902714103" }, "nvim-genghis": { "branch": "main", "commit": "8613fc1b43db6cc761733b3630eabff9e86296f7" }, "nvim-genghis": { "branch": "main", "commit": "1e6855be88e2266c612903dbc337222b59a06e44" }, "nvim-neoclip.lua": { "branch": "main", "commit": "798cd0592a81c185465db3a091a0ff8a21af60fd" }, "nvim-spectre": { "branch": "master", "commit": "2b012554a2536465243c0dff3605b5927c49ed23" }, "nvim-spectre": { "branch": "master", "commit": "9653847cf2f225648967f6e9363643e327387579" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "60e8c288e011403f248b5f6478dde12bed8a6c55" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, "nvim-web-devicons": { "branch": "master", "commit": "b3468391470034353f0e5110c70babb5c62967d3" }, "oil.nvim": { "branch": "master", "commit": "e462a3446505185adf063566f5007771b69027a1" }, "oil.nvim": { "branch": "master", "commit": "8bb35eb81a48f14c4a1ef480c2bbb87ceb7cd8bb" }, "qf_helper.nvim": { "branch": "master", "commit": "91dad029c11d1c39b0d1276eda52616f651072be" }, "resession.nvim": { "branch": "master", "commit": "dc8825439c619030925543a444c4186a2487c200" }, "schemastore.nvim": { "branch": "main", "commit": "f660f74bcaae950a77c69dda91270063c8cbd692" }, "schemastore.nvim": { "branch": "main", "commit": "f7cae6f1b38cb296f48ce1a9c5ed1a419d912a42" }, "suda.vim": { "branch": "master", "commit": "d0ccc1a5172f6a26182238767e60e08b931d11fa" }, "suda.vim": { "branch": "master", "commit": "04469d855e36fffcda6be036eb7ff005f64fa0d6" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" }, "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" }, "venn.nvim": { "branch": "main", "commit": "e4d68341a73dd56c64955058821a58295fb337b1" }, "venn.nvim": { "branch": "main", "commit": "a5430d75875acbe93e9685cdeb78c6eb2a329ed5" }, "vim-vscode-snippets": { "branch": "master", "commit": "812e60d1c648f889328761ec71daff09d1eb3177" },+73 / −66 text lines
local diagnostic_icons = { icon.error, icon.warn, icon.info, icon.hint }local diagnostic_icons = { icon.error, icon.warn, icon.info, icon.hint, } return string.format( '%s: %s', display_name[context.severity], context.message ) return string.format( '%s: %s', display_name[context.severity], context.message ) local ns = vim.api.nvim_create_namespace( 'test' .. tostring( severity ) ) local bufnr = vim.api.nvim_get_current_buf() local options = { bufnr = bufnr, lnum = line, end_lnum = line, col = 0, severity = severity, message = 'This is a test ' .. tostring( severity ) .. ' diagnostic', } local ns = vim.api.nvim_create_namespace( 'test' .. tostring( severity ) ) local bufnr = vim.api.nvim_get_current_buf() local options = { bufnr = bufnr, lnum = line, end_lnum = line, col = 0, severity = severity, message = 'This is a test ' .. tostring( severity ) .. ' diagnostic', }+414 / −379 text lines
vim.validate { command = { command, { 'string', 'table', }, }, } vim.validate { command = { command, { 'string', 'table', }, }, } local buffer_path = vim.api.nvim_buf_get_name( bufnr ) local buffer_path = vim.api.nvim_buf_get_name( bufnr ) debug.print( string.format( 'searching lsp client for: match: %s, buffer: %s, path: %s', match, bufnr, buffer_path ) ) 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', 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 {} 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', 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 {} --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 {} --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 {} for _, config in ipairs( potential_client_configs ) do local root_dir = type( config.root_dir ) == 'string' and config.root_dir or config.root_dir( buffer_path ) local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = table.extend( 'force', capabilities, config.capabilities ) local settings = config.settings local settings_override = project_local_lsp_settings[config.name] if settings_override then debug.print( 'overriding settings with project local settings', settings, settings_override ) settings = vim.tbl_deep_extend( 'force', settings, settings_override ) end debug.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 = { config.root_dir(buffer_path) }, -- TODO: i think workspaces can only ever be declared per project. i cannot think of a generic way to calculate those, like with root_dir. maybe a toml/ini file in root_dir sets these? 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 ) debug.print( 'LSP CLIENT EXIT', code, signal, client_id ) end, on_attach = function ( client, attach_bufnr ) debug.print( 'LSP CLIENT ATTACH', client, attach_bufnr ) end, trace = debug.get() and 'on' or 'off', flags = { allow_incremental_sync = true, debounce_text_changes = 250, exit_timeout = 200, }, } dbg.print( 'patched project local workspace folders', project_local_workspace_folders ) local lsp_starter = config.custom_start or vim.lsp.start debug.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 ) debug.print( 'lsp resuse client', existing_client.name, existing_client.workspace_folders, new_config.name, new_config.root_dir ) 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 --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 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 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 dbg.print( 'starting command:', config.command ) if not (new_root_raw and existing_root_raw) then return false end 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 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 lsp_starter = config.custom_start or vim.lsp.start local reuse = same_name and same_root debug.print( 'reusing lsp client?', reuse ) return reuse end, } ) 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( 'ATTACHING LSP CLIENT', config.name ) end if client.server_capabilities.documentSymbolProvider then local navic_ok, navic = pcall( require, 'nvim-navic' ) if navic_ok then navic.attach( client, bufnr ) else vim.notify 'nvim-navic not found. could not attach to lsp client.' end local navbuddy_ok, navbuddy = pcall( require, 'nvim-navbuddy' ) if navbuddy_ok then navbuddy.attach( client, bufnr ) map.normal { description = 'Open overview of symbols in current buffer', category = 'lsp', keys = '<leader>lo', command = function () navbuddy.open( bufnr ) end, buffer = bufnr, } else vim.notify 'nvim-navbuddy not found. could not attach to lsp client.' end end if client.server_capabilities.documentSymbolProvider then local navic_ok, navic = pcall( require, 'nvim-navic' ) if navic_ok then navic.attach( client, bufnr ) else vim.notify 'nvim-navic not found. could not attach to lsp client.' end local navbuddy_ok, navbuddy = pcall( require, 'nvim-navbuddy' ) if navbuddy_ok then navbuddy.attach( client, bufnr ) map.normal { description = 'Open overview of symbols in current buffer', category = 'lsp', keys = '<leader>lo', command = function () navbuddy.open( bufnr ) end, buffer = bufnr, } else vim.notify 'nvim-navbuddy not found. could not attach to lsp client.' end end if client.server_capabilities.documentHighlightProvider then -- the timer has application lifetime. no need to close local delay = 300 local debounced_highlight = defer.debounce_leading( vim.lsp.buf.document_highlight, delay ) local debounced_clear = defer.debounce_leading( vim.lsp.buf.clear_references, delay ) if client.server_capabilities.documentHighlightProvider then -- the timer has application lifetime. no need to close local delay = 300 local debounced_highlight = defer.debounce_leading( vim.lsp.buf.document_highlight, delay ) local debounced_clear = defer.debounce_leading( vim.lsp.buf.clear_references, delay ) auto 'document_highlight' { { description = 'Highlight symbol under cursor on hold', events = 'CursorHold', buffer = bufnr, command = debounced_highlight, }, { description = 'Remove highlight from symbol under cursor on move', events = { 'CursorMoved', 'InsertEnter', }, buffer = bufnr, command = debounced_clear, }, } end auto 'document_highlight' { { description = 'Highlight symbol under cursor on hold', events = 'CursorHold', buffer = bufnr, command = debounced_highlight, }, { description = 'Remove highlight from symbol under cursor on move', events = { 'CursorMoved', 'InsertEnter', }, buffer = bufnr, command = debounced_clear, }, } end { description = 'Start or reuse LSP client', events = 'FileType', command = lsp_start, }, { description = 'Hook: LSP client attached to buffer', events = 'LspAttach', command = lsp_attach, }, { description = 'Hook: LSP client detached from buffer', events = 'LspDetach', command = lsp_detach, }, { description = 'Semantic Tokens from the LSP', events = 'LspTokenUpdate', command = token_update, }, { description = 'Start or reuse LSP client', events = 'FileType', command = lsp_start, }, { description = 'Hook: LSP client attached to buffer', events = 'LspAttach', command = lsp_attach, }, { description = 'Hook: LSP client detached from buffer', events = 'LspDetach', command = lsp_detach, }, { description = 'Semantic Tokens from the LSP', events = 'LspTokenUpdate', command = token_update, }, 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() 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() Class = icon.class, Color = icon.color, Constant = icon.constant, Constructor = icon.constructor, Enum = icon.enum, EnumMember = icon.enum_member, Field = icon.field, File = icon.file, Folder = icon.folder, Function = icon['function'], Interface = icon.interface, Keyword = icon.keyword, Method = icon.method, Module = icon.module, Property = icon.property, Snippet = icon.snippet, Struct = icon.struct, Text = icon.text, Unit = icon.unit, Value = icon.value, Variable = icon.variable, Class = icon.class, Color = icon.color, Constant = icon.constant, Constructor = icon.constructor, Enum = icon.enum, EnumMember = icon.enum_member, Field = icon.field, File = icon.file, Folder = icon.folder, Function = icon['function'], Interface = icon.interface, Keyword = icon.keyword, Method = icon.method, Module = icon.module, Property = icon.property, Snippet = icon.snippet, Struct = icon.struct, Text = icon.text, Unit = icon.unit, Value = icon.value, Variable = icon.variable,+2 / −1 text lines
+60 / −71 text lines
vim.g.border_style = { style = { top_left = '╭', top = '─', top_right = '╮', left = '│', right = '│', bottom_left = '╰', bottom = '─', bottom_right = '╯', },}vim.g.border_style = 'solid' -- vim.g.neovide_floating_blur_amount_x = 12.0 -- vim.g.neovide_floating_blur_amount_y = 12.0 -- vim.g.neovide_scroll_animation_length = 0.69 -- vim.g.neovide_fullscreen = true vim.g.neovide_remember_window_size = true vim.g.neovide_profiler = false -- vim.g.neovide_cursor_animation_length = 0.42 -- vim.g.neovide_cursor_trail_length = 0.42 vim.g.neovide_cursor_vfx_mode = 'railgun' -- vim.g.neovide_cursor_unfocused_outline_width = 0.125 vim.g.neovide_cursor_antialiasing = true vim.g.neovide_padding_top = 0 vim.g.neovide_padding_bottom = 0 vim.g.neovide_padding_right = 0 vim.g.neovide_padding_left = 0 vim.g.neovide_hide_mouse_when_typing = true vim.g.neovide_theme = 'auto' vim.g.neovide_refresh_rate = vim.uv.os_gethostname() == 'pop-os' and 144 or 60 vim.g.neovide_refresh_rate_idle = 5 -- vim.g.neovide_floating_blur_amount_x = 12.0 -- vim.g.neovide_floating_blur_amount_y = 12.0 -- vim.g.neovide_scroll_animation_length = 0.69 -- vim.g.neovide_fullscreen = true vim.g.neovide_remember_window_size = true vim.g.neovide_profiler = false -- vim.g.neovide_cursor_animation_length = 0.42 -- vim.g.neovide_cursor_trail_length = 0.42 vim.g.neovide_cursor_vfx_mode = 'railgun' -- vim.g.neovide_cursor_unfocused_outline_width = 0.125 vim.g.neovide_cursor_antialiasing = true vim.g.neovide_padding_top = 0 vim.g.neovide_padding_bottom = 0 vim.g.neovide_padding_right = 0 vim.g.neovide_padding_left = 0 vim.g.neovide_hide_mouse_when_typing = true vim.g.neovide_theme = 'auto' vim.g.neovide_refresh_rate = vim.uv.os_gethostname() == 'pop-os' and 144 or 60 vim.g.neovide_refresh_rate_idle = 5new file mode 100644+54 / −0 text lines
local debug = require 'std.dbg'local map = require 'std.map'local user_command = require 'std.user_command'local format = function () prequire 'conform'.format( { async = false, lsp_fallback = true, }, function ( err ) if err and debug.get() then vim.print( 'Format failed', err ) end end )endmap.N { description = 'Format buffer', category = 'format', keys = '=', command = format,}user_command.Format'Format the current buffer' ( format )return { 'stevearc/conform.nvim', cmd = { 'ConformInfo', }, opts = { formatters_by_ft = { -- https://github.com/razziel89/mdslw/issues/14 markdown = { 'mdslw', }, -- lua = { "stylua" }, toml = { 'taplo', }, sh = { 'shfmt', }, just = { 'just', }, zig = { 'zigfmt', }, -- Use the "*" file type to run formatters on all file types. ['*'] = { 'injected', 'typos', }, -- Use the "_" file type to run formatters on file types that don't -- have other formatters configured. ['_'] = { 'trim_whitespace', 'trim_newlines', }, }, formatters = { mdslw = { -- remove `:` from the default set of end markers -- prepend_args = { '--end-markers', '?!.', }, }, }, log_level = debug.get() and vim.log.levels.TRACE or vim.log.levels.INFO, }, init = function () vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" end,}deleted file mode 100644+0 / −54 text lines
local debug = require 'std.dbg'local map = require 'std.map'local user_command = require 'std.user_command'local format = function () prequire 'conform'.format( { async = false, lsp_fallback = true, }, function ( err ) if err and debug.get() then vim.print( 'Format failed', err ) end end )endmap.N { description = 'Format buffer', category = 'format', keys = '=', command = format,}user_command.Format'Format the current buffer' ( format )return { 'stevearc/conform.nvim', cmd = { 'ConformInfo', }, opts = { formatters_by_ft = { -- https://github.com/razziel89/mdslw/issues/14 markdown = { 'mdslw', }, -- lua = { "stylua" }, toml = { 'taplo', }, sh = { 'shfmt', }, just = { 'just', }, zig = { 'zigfmt', }, -- Use the "*" file type to run formatters on all file types. ['*'] = { 'injected', 'typos', }, -- Use the "_" file type to run formatters on file types that don't -- have other formatters configured. ['_'] = { 'trim_whitespace', 'trim_newlines', }, }, formatters = { mdslw = { -- remove `:` from the default set of end markers -- prepend_args = { '--end-markers', '?!.', }, }, }, log_level = debug.get() and vim.log.levels.TRACE or vim.log.levels.INFO, }, init = function () vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" end,}new file mode 100644+1 / −0 text lines
return { 'bugabinga/nvim-jdtls', }new file mode 100644+114 / −0 text lines
--FIXME: own thisreturn { 'L3MON4D3/LuaSnip', dependencies = { 'stevearc/vim-vscode-snippets', }, config = function () local luasnip = require 'luasnip' local has_vim_snippet, snippet = pcall( require, 'vim.snippet' ) require 'luasnip.loaders.from_vscode'.lazy_load() vim.keymap.set( 's', '<Tab>', '<Plug>luasnip-jump-next' ) vim.keymap.set( 's', '<C-h>', '<Plug>luasnip-jump-prev' ) vim.keymap.set( 's', '<C-l>', '<Plug>luasnip-jump-next' ) vim.keymap.set( { 'i', 's', }, '<C-k>', function () pcall( luasnip.change_choice, -1 ) end ) vim.keymap.set( { 'i', 's', }, '<C-j>', function () pcall( luasnip.change_choice, 1 ) end ) local aug = vim.api.nvim_create_augroup( 'ClearLuasnipSession', { clear = true, } ) -- Can't use InsertLeave here because that fires when we go to select mode vim.api.nvim_create_autocmd( 'CursorHold', { desc = 'Deactivate snippet after leaving insert/select mode', pattern = '*', group = aug, callback = function () vim.cmd.LuaSnipUnlinkCurrent { mods = { emsg_silent = true, }, } if has_vim_snippet then snippet.exit() end end, } ) vim.keymap.set( 'i', '<C-h>', function () if luasnip.get_active_snip() then luasnip.jump( -1 ) elseif has_vim_snippet and snippet.active() then snippet.jump( -1 ) else local cur = vim.api.nvim_win_get_cursor( 0 ) pcall( vim.api.nvim_win_set_cursor, 0, { cur[1], cur[2] - 1, } ) end end ) vim.keymap.set( 'i', '<C-l>', function () if luasnip.get_active_snip() then luasnip.jump( 1 ) elseif has_vim_snippet and snippet.active() then snippet.jump( 1 ) else local cur = vim.api.nvim_win_get_cursor( 0 ) pcall( vim.api.nvim_win_set_cursor, 0, { cur[1], cur[2] + 1, } ) end end ) -- Required to support nested placeholders -- From https://github.com/L3MON4D3/LuaSnip/wiki/Nice-Configs#imitate-vscodes-behaviour-for-nested-placeholders local util = require 'luasnip.util.util' luasnip.config.setup { store_selection_keys = '<Tab>', updateevents = 'TextChanged,TextChangedI', parser_nested_assembler = function ( _, snippet ) local select = function ( snip, no_move ) snip.parent:enter_node( snip.indx ) -- upon deletion, extmarks of inner nodes should shift to end of -- placeholder-text. for _, node in ipairs( snip.nodes ) do node:set_mark_rgrav( true, true ) end -- SELECT all text inside the snippet. if not no_move then vim.api.nvim_feedkeys( vim.api.nvim_replace_termcodes( '<Esc>', true, false, true ), 'n', true ) local pos_begin, pos_end = snip.mark:pos_begin_end() util.normal_move_on( pos_begin ) vim.api.nvim_feedkeys( vim.api.nvim_replace_termcodes( 'v', true, false, true ), 'n', true ) util.normal_move_before( pos_end ) vim.api.nvim_feedkeys( vim.api.nvim_replace_termcodes( 'o<C-G>', true, false, true ), 'n', true ) end end function snippet:jump_into( dir, no_move ) if self.active then -- inside snippet, but not selected. if dir == 1 then self:input_leave() return self.next:jump_into( dir, no_move ) else select( self, no_move ) return self end else -- jumping in from outside snippet. self:input_enter() if dir == 1 then select( self, no_move ) return self else return self.inner_last:jump_into( dir, no_move ) end end end -- this is called only if the snippet is currently selected. function snippet:jump_from( dir, no_move ) if dir == 1 then return self.inner_first:jump_into( dir, no_move ) else self:input_leave() return self.prev:jump_into( dir, no_move ) end end return snippet end, } end,}new file mode 100644+14 / −0 text lines
+10 / −10 text lines
deleted file mode 100644+0 / −1 text lines
return { 'bugabinga/nvim-jdtls', }deleted file mode 100644+0 / −14 text lines
new file mode 100644+162 / −0 text lines
local map = require 'std.map'local user_command = require 'std.user_command'map.normal { description = 'Toggle task view', category = 'tasks', keys = '<leader>99', command = function () prequire 'overseer'.toggle { enter = true, direction = 'right', } end,}map.normal { description = 'Run task', category = 'tasks', keys = '<leader>9r', command = function () prequire 'overseer'._run_template() end,}map.normal { description = 'Run any command as task', category = 'tasks', keys = '<leader>9c', command = function () prequire 'overseer'._run_command() end,}map.normal { description = 'Load task bundle', category = 'tasks', keys = '<leader>9r', command = function () prequire 'overseer'._load_bundle() end,}map.normal { description = 'Run an action on the most recent task, or the task under the cursor', category = 'tasks', keys = '<leader>9d', command = function () prequire 'overseer'._quick_action() end,}map.normal { description = 'Select a task to run an action on', category = 'tasks', keys = '<leader>9s', command = function () prequire 'overseer'._task_action() end,}map.normal { description = 'Display diagnostic information about overseer', category = 'tasks', keys = '<leader>9i', command = function () prequire 'overseer'._info() end,}user_command.OverseerDebugParser'Open a tab with windows laid out for debugging a parser' ( function () prequire 'overseer'.debug_parser() end )user_command.Grep'Run your grepprg as an Overseer task' { nargs = '*', bang = true, bar = true, complete = 'file', } ( function ( params ) local args = vim.fn.expandcmd( params.args ) -- Insert args at the '$*' in the grepprg local cmd, num_subs = vim.o.grepprg:gsub( '%$%*', args ) if num_subs == 0 then cmd = cmd .. ' ' .. args end local cwd prequire( 'oil', function ( oil ) cwd = oil.get_current_dir() end ) local task = prequire 'overseer'.new_task { cmd = cmd, cwd = cwd, name = 'grep ' .. args, components = { { 'on_output_quickfix', errorformat = vim.o.grepformat, open = not params.bang, open_height = 8, items_only = true, }, -- We don't care to keep this around as long as most tasks { 'on_complete_dispose', timeout = 30, }, 'default', }, } task:start() end )user_command.Make'Run your makeprg as an Overseer task' { nargs = '*', bang = true, } ( function ( params ) -- Insert args at the '$*' in the makeprg local cmd, num_subs = vim.o.makeprg:gsub( '%$%*', params.args ) if num_subs == 0 then cmd = cmd .. ' ' .. params.args end local task = prequire 'overseer'.new_task { cmd = vim.fn.expandcmd( cmd ), components = { { 'on_output_quickfix', open = not params.bang, open_height = 8, }, 'unique', 'default', }, } task:start() end )return { { 'stevearc/resession.nvim', lazy = true, opts = { extensions = { overseer = { status = { 'RUNNING', }, }, }, }, }, { 'stevearc/overseer.nvim', opts = { strategy = { 'jobstart', }, dap = false, log = { { type = 'echo', level = vim.log.levels.WARN, }, { type = 'file', filename = 'overseer.log', level = vim.log.levels.DEBUG, }, }, component_aliases = { default = { { 'display_duration', detail_level = 2, }, 'on_output_summarize', 'on_exit_set_status', { 'on_complete_notify', system = 'unfocused', }, 'on_complete_dispose', }, default_neotest = { 'unique', { 'on_complete_notify', system = 'unfocused', on_change = true, }, 'default', }, }, }, }, }new file mode 100644+45 / −0 text lines
local map = require 'std.map'map.normal { description = 'Grep search for word under cursor', category = 'search', keys = 'gw', command = '<cmd>cclose <bar> Grep <cword><cr>',}map.normal { description = 'Goto next quickfix item', category = 'navigation', keys = ']q', command = '<cmd>QNext<cr>',}map.normal { description = 'Goto previous quickfix item', category = 'navigation', keys = '[q', command = '<cmd>QPrev<cr>',}map.normal { description = 'Toggle open quickfix window', category = 'navigation', keys = '<leader>Q', command = '<cmd>QFToggle!<CR>',}map.normal { description = 'Toggle open loclist window', category = 'navigation', keys = '<leader>L', command = '<cmd>LLToggle!<CR>',}return { 'stevearc/qf_helper.nvim', ft = 'qf', cmd = { 'QNext', 'QPrev', 'QFToggle', 'QFOpen', 'LLToggle', }, opts = { prefer_loclist = false, },}deleted file mode 100644+0 / −45 text lines
local map = require 'std.map'map.normal { description = 'Grep search for word under cursor', category = 'search', keys = 'gw', command = '<cmd>cclose <bar> Grep <cword><cr>',}map.normal { description = 'Goto next quickfix item', category = 'navigation', keys = ']q', command = '<cmd>QNext<cr>',}map.normal { description = 'Goto previous quickfix item', category = 'navigation', keys = '[q', command = '<cmd>QPrev<cr>',}map.normal { description = 'Toggle open quickfix window', category = 'navigation', keys = '<leader>Q', command = '<cmd>QFToggle!<CR>',}map.normal { description = 'Toggle open loclist window', category = 'navigation', keys = '<leader>L', command = '<cmd>LLToggle!<CR>',}return { 'stevearc/qf_helper.nvim', ft = 'qf', cmd = { 'QNext', 'QPrev', 'QFToggle', 'QFOpen', 'LLToggle', }, opts = { prefer_loclist = false, },}deleted file mode 100644+0 / −114 text lines
--FIXME: own thisreturn { 'L3MON4D3/LuaSnip', dependencies = { 'stevearc/vim-vscode-snippets', }, config = function () local luasnip = require 'luasnip' local has_vim_snippet, snippet = pcall( require, 'vim.snippet' ) require 'luasnip.loaders.from_vscode'.lazy_load() vim.keymap.set( 's', '<Tab>', '<Plug>luasnip-jump-next' ) vim.keymap.set( 's', '<C-h>', '<Plug>luasnip-jump-prev' ) vim.keymap.set( 's', '<C-l>', '<Plug>luasnip-jump-next' ) vim.keymap.set( { 'i', 's', }, '<C-k>', function () pcall( luasnip.change_choice, -1 ) end ) vim.keymap.set( { 'i', 's', }, '<C-j>', function () pcall( luasnip.change_choice, 1 ) end ) local aug = vim.api.nvim_create_augroup( 'ClearLuasnipSession', { clear = true, } ) -- Can't use InsertLeave here because that fires when we go to select mode vim.api.nvim_create_autocmd( 'CursorHold', { desc = 'Deactivate snippet after leaving insert/select mode', pattern = '*', group = aug, callback = function () vim.cmd.LuaSnipUnlinkCurrent { mods = { emsg_silent = true, }, } if has_vim_snippet then snippet.exit() end end, } ) vim.keymap.set( 'i', '<C-h>', function () if luasnip.get_active_snip() then luasnip.jump( -1 ) elseif has_vim_snippet and snippet.active() then snippet.jump( -1 ) else local cur = vim.api.nvim_win_get_cursor( 0 ) pcall( vim.api.nvim_win_set_cursor, 0, { cur[1], cur[2] - 1, } ) end end ) vim.keymap.set( 'i', '<C-l>', function () if luasnip.get_active_snip() then luasnip.jump( 1 ) elseif has_vim_snippet and snippet.active() then snippet.jump( 1 ) else local cur = vim.api.nvim_win_get_cursor( 0 ) pcall( vim.api.nvim_win_set_cursor, 0, { cur[1], cur[2] + 1, } ) end end ) -- Required to support nested placeholders -- From https://github.com/L3MON4D3/LuaSnip/wiki/Nice-Configs#imitate-vscodes-behaviour-for-nested-placeholders local util = require 'luasnip.util.util' luasnip.config.setup { store_selection_keys = '<Tab>', updateevents = 'TextChanged,TextChangedI', parser_nested_assembler = function ( _, snippet ) local select = function ( snip, no_move ) snip.parent:enter_node( snip.indx ) -- upon deletion, extmarks of inner nodes should shift to end of -- placeholder-text. for _, node in ipairs( snip.nodes ) do node:set_mark_rgrav( true, true ) end -- SELECT all text inside the snippet. if not no_move then vim.api.nvim_feedkeys( vim.api.nvim_replace_termcodes( '<Esc>', true, false, true ), 'n', true ) local pos_begin, pos_end = snip.mark:pos_begin_end() util.normal_move_on( pos_begin ) vim.api.nvim_feedkeys( vim.api.nvim_replace_termcodes( 'v', true, false, true ), 'n', true ) util.normal_move_before( pos_end ) vim.api.nvim_feedkeys( vim.api.nvim_replace_termcodes( 'o<C-G>', true, false, true ), 'n', true ) end end function snippet:jump_into( dir, no_move ) if self.active then -- inside snippet, but not selected. if dir == 1 then self:input_leave() return self.next:jump_into( dir, no_move ) else select( self, no_move ) return self end else -- jumping in from outside snippet. self:input_enter() if dir == 1 then select( self, no_move ) return self else return self.inner_last:jump_into( dir, no_move ) end end end -- this is called only if the snippet is currently selected. function snippet:jump_from( dir, no_move ) if dir == 1 then return self.inner_first:jump_into( dir, no_move ) else self:input_leave() return self.prev:jump_into( dir, no_move ) end end return snippet end, } end,}+4 / −4 text lines
command = function () spectre.open_visual { select_word = true, } end, command = function () require 'spectre'.open_visual { select_word = true, } end, command = function () spectre.open_visual() end, command = function () require 'spectre'.open_visual() end,deleted file mode 100644+0 / −162 text lines
local map = require 'std.map'local user_command = require 'std.user_command'map.normal { description = 'Toggle task view', category = 'tasks', keys = '<leader>99', command = function () prequire 'overseer'.toggle { enter = true, direction = 'right', } end,}map.normal { description = 'Run task', category = 'tasks', keys = '<leader>9r', command = function () prequire 'overseer'._run_template() end,}map.normal { description = 'Run any command as task', category = 'tasks', keys = '<leader>9c', command = function () prequire 'overseer'._run_command() end,}map.normal { description = 'Load task bundle', category = 'tasks', keys = '<leader>9r', command = function () prequire 'overseer'._load_bundle() end,}map.normal { description = 'Run an action on the most recent task, or the task under the cursor', category = 'tasks', keys = '<leader>9d', command = function () prequire 'overseer'._quick_action() end,}map.normal { description = 'Select a task to run an action on', category = 'tasks', keys = '<leader>9s', command = function () prequire 'overseer'._task_action() end,}map.normal { description = 'Display diagnostic information about overseer', category = 'tasks', keys = '<leader>9i', command = function () prequire 'overseer'._info() end,}user_command.OverseerDebugParser'Open a tab with windows laid out for debugging a parser' ( function () prequire 'overseer'.debug_parser() end )user_command.Grep'Run your grepprg as an Overseer task' { nargs = '*', bang = true, bar = true, complete = 'file', } ( function ( params ) local args = vim.fn.expandcmd( params.args ) -- Insert args at the '$*' in the grepprg local cmd, num_subs = vim.o.grepprg:gsub( '%$%*', args ) if num_subs == 0 then cmd = cmd .. ' ' .. args end local cwd prequire( 'oil', function ( oil ) cwd = oil.get_current_dir() end ) local task = prequire 'overseer'.new_task { cmd = cmd, cwd = cwd, name = 'grep ' .. args, components = { { 'on_output_quickfix', errorformat = vim.o.grepformat, open = not params.bang, open_height = 8, items_only = true, }, -- We don't care to keep this around as long as most tasks { 'on_complete_dispose', timeout = 30, }, 'default', }, } task:start() end )user_command.Make'Run your makeprg as an Overseer task' { nargs = '*', bang = true, } ( function ( params ) -- Insert args at the '$*' in the makeprg local cmd, num_subs = vim.o.makeprg:gsub( '%$%*', params.args ) if num_subs == 0 then cmd = cmd .. ' ' .. params.args end local task = prequire 'overseer'.new_task { cmd = vim.fn.expandcmd( cmd ), components = { { 'on_output_quickfix', open = not params.bang, open_height = 8, }, 'unique', 'default', }, } task:start() end )return { { 'stevearc/resession.nvim', lazy = true, opts = { extensions = { overseer = { status = { 'RUNNING', }, }, }, }, }, { 'stevearc/overseer.nvim', opts = { strategy = { 'jobstart', }, dap = false, log = { { type = 'echo', level = vim.log.levels.WARN, }, { type = 'file', filename = 'overseer.log', level = vim.log.levels.DEBUG, }, }, component_aliases = { default = { { 'display_duration', detail_level = 2, }, 'on_output_summarize', 'on_exit_set_status', { 'on_complete_notify', system = 'unfocused', }, 'on_complete_dispose', }, default_neotest = { 'unique', { 'on_complete_notify', system = 'unfocused', on_change = true, }, 'default', }, }, }, }, }+19 / −22 text lines
{ name = '.save.actions.lua', weight = DEFINITELY, }, { name = '.lsp.settings.lua', weight = DEFINITELY, }, { name = '.lazy.specs.lua', weight = DEFINITELY, }, { name = '.editorconfig', weight = LIKELY, }, { name = '.git', weight = LIKELY, }, { name = '.gitignore', weight = LIKELY, }, { name = '.svn', weight = LIKELY, }, { name = 'justfile', weight = LIKELY, }, { name = 'Makefile', weight = LIKELY, }, { name = 'Jenkinsfile', weight = MAYBE, }, { name = 'LICENSE', weight = MAYBE, }, { name = 'LICENSE.md', weight = MAYBE, }, { name = 'LICENSE.txt', weight = MAYBE, }, { name = 'COPYING', weight = MAYBE, }, { name = 'README', weight = MAYBE, }, { name = 'README.md', weight = MAYBE, }, { name = 'flake.nix', weight = MAYBE, }, { name = 'flake.nix', weight = MAYBE, }, { name = '.save.actions.lua', weight = DEFINITELY, }, { name = '.lsp.settings.lua', weight = DEFINITELY, }, { name = '.lsp.workspace_folders.lua', weight = DEFINITELY, }, { name = '.lazy.specs.lua', weight = DEFINITELY, }, { name = '.editorconfig', weight = LIKELY, }, { name = '.git', weight = LIKELY, }, { name = '.gitignore', weight = LIKELY, }, { name = '.svn', weight = LIKELY, }, { name = 'justfile', weight = LIKELY, }, { name = 'Makefile', weight = LIKELY, }, { name = 'Jenkinsfile', weight = MAYBE, }, { name = 'LICENSE', weight = MAYBE, }, { name = 'LICENSE.md', weight = MAYBE, }, { name = 'LICENSE.txt', weight = MAYBE, }, { name = 'COPYING', weight = MAYBE, }, { name = 'README', weight = MAYBE, }, { name = 'README.md', weight = MAYBE, }, { name = 'flake.nix', weight = MAYBE, }, { name = 'flake.nix', weight = MAYBE, },+2 / −0 text lines
Binary size (old → new): 822 → 848 bytes.