rework keymaps and plugin config

- Change leader from space to comma
- Move opencode keymaps into plugin config
- Move picker keymaps from <leader>p to <leader>f
- Change buffer delete mapping from bd to bk
- Add DAP debugging keymaps and dap-view
- Remove zk-nvim, checkmate plugins
- Add claude-code, conjure, scnvim plugins
- Update LSP servers: replace basedpyright with ty, add gopls/clojure_lsp/harper_ls/tinymist
- Enable inlay hints on LspAttach
- Enable go/sql/typst tree-sitter
- Add htmlhint formatter
- Configure opencode with snacks terminal
This commit is contained in:
2026-08-02 17:09:21 +02:00
parent 35f0723076
commit fabc3362a1
4 changed files with 200 additions and 170 deletions
+50 -74
View File
@@ -14,13 +14,6 @@ local nmap = function(lhs, rhs, desc)
vim.keymap.set('n', lhs, rhs, { desc = desc })
end
-- Paste linewise before/after current line
-- Usage: `yiw` to yank a word and `]p` to put it on the next line.
nmap('[p', '<Cmd>exe "put! " . v:register<CR>', 'Paste Above')
nmap(']p', '<Cmd>exe "put " . v:register<CR>', 'Paste Below')
-- Many general mappings are created by 'mini.basics'. See 'plugin/30_mini.lua'
-- stylua: ignore start
-- The next part (until `-- stylua: ignore end`) is aligned manually for easier
-- reading. Consider preserving this or remove `-- stylua` lines to autoformat.
@@ -38,10 +31,9 @@ nmap(']p', '<Cmd>exe "put " . v:register<CR>', 'Paste Below')
-- This is used to provide 'mini.clue' with extra clues.
-- Add an entry if you create a new group.
_G.Config.leader_group_clues = {
{ mode = 'n', keys = '<Leader>a', desc = '+AI' },
{ mode = 'n', keys = '<Leader>b', desc = '+Buffer' },
{ mode = 'n', keys = '<Leader>e', desc = '+Explore/Edit' },
{ mode = 'n', keys = '<Leader>p', desc = '+Pick' },
{ mode = 'n', keys = '<Leader>f', desc = '+Pick' },
{ mode = 'n', keys = '<Leader>g', desc = '+Git' },
{ mode = 'n', keys = '<Leader>l', desc = '+Language' },
{ mode = 'n', keys = '<Leader>m', desc = '+Map' },
@@ -68,12 +60,6 @@ local vmap_leader = function(suffix, rhs, desc)
vim.keymap.set('v', '<Leader>' .. suffix, rhs, { desc = desc })
end
-- a is for 'AI'
nmap_leader('ac', ':lua require("opencode").toggle()<CR>', 'Toggle Opencode')
nmap_leader('af', ':lua require("opencode").select()<CR>', 'Execute Opencode action...')
nmap_leader('aa', ':luat require("opencode").ask("@this: ", { submit = true })', 'Ask Opencode')
-- b is for 'Buffer'. Common usage:
-- - `<Leader>bs` - create scratch (temporary) buffer
-- - `<Leader>ba` - navigate to the alternative buffer
@@ -82,11 +68,11 @@ local new_scratch_buffer = function()
vim.api.nvim_win_set_buf(0, vim.api.nvim_create_buf(true, true))
end
nmap_leader('ba', '<Cmd>b#<CR>', 'Alternate')
nmap_leader('bd', '<Cmd>lua MiniBufremove.delete()<CR>', 'Delete')
nmap_leader('bD', '<Cmd>lua MiniBufremove.delete(0, true)<CR>', 'Delete!')
nmap_leader('bs', new_scratch_buffer, 'Scratch')
nmap_leader('bw', '<Cmd>write<CR>', 'Write')
nmap_leader('ba', '<Cmd>b#<CR>', 'Alternate')
nmap_leader('bk', '<Cmd>lua MiniBufremove.delete()<CR>', 'Kill')
nmap_leader('bK', '<Cmd>lua MiniBufremove.delete(0, true)<CR>', 'KIIIILLL!')
nmap_leader('bs', new_scratch_buffer, 'Scratch')
nmap_leader('bw', '<Cmd>write<CR>', 'Write')
-- e is for 'Explore' and 'Edit'. Common usage:
-- - `<Leader>ed` - open explorer at current working directory
@@ -104,15 +90,15 @@ local explore_quickfix = function()
vim.cmd('copen')
end
nmap_leader('ed', '<Cmd>lua MiniFiles.open()<CR>', 'Directory')
nmap_leader('ef', explore_at_file, 'File directory')
nmap_leader('ei', '<Cmd>edit $MYVIMRC<CR>', 'init.lua')
nmap_leader('ek', edit_plugin_file('20_keymaps.lua'), 'Keymaps config')
nmap_leader('em', edit_plugin_file('30_mini.lua'), 'MINI config')
nmap_leader('ed', '<Cmd>lua MiniFiles.open()<CR>', 'Directory')
nmap_leader('ef', explore_at_file, 'File directory')
nmap_leader('ei', '<Cmd>edit $MYVIMRC<CR>', 'init.lua')
nmap_leader('ek', edit_plugin_file('20_keymaps.lua'), 'Keymaps config')
nmap_leader('em', edit_plugin_file('30_mini.lua'), 'MINI config')
nmap_leader('en', '<Cmd>lua MiniNotify.show_history()<CR>', 'Notifications')
nmap_leader('eo', edit_plugin_file('10_options.lua'), 'Options config')
nmap_leader('ep', edit_plugin_file('40_plugins.lua'), 'Plugins config')
nmap_leader('eq', explore_quickfix, 'Quickfix')
nmap_leader('eo', edit_plugin_file('10_options.lua'), 'Options config')
nmap_leader('ep', edit_plugin_file('40_plugins.lua'), 'Plugins config')
nmap_leader('eq', explore_quickfix, 'Quickfix')
-- f is for 'Fuzzy Find'. Common usage:
-- - `<Leader>ff` - find files; for best performance requires `ripgrep`
@@ -124,24 +110,23 @@ nmap_leader('eq', explore_quickfix, 'Quickfix')
-- All these use 'mini.pick'. See `:h MiniPick-overview` for an overview.
local pick_workspace_symbols_live = '<Cmd>Pick lsp scope="workspace_symbol_live"<CR>'
nmap_leader('p/', '<Cmd>Pick history scope="/"<CR>', '"/" history')
nmap_leader('p:', '<Cmd>Pick history scope=":"<CR>', '":" history')
nmap_leader('pb', '<Cmd>Pick buffers<CR>', 'Buffers')
nmap_leader('pd', '<Cmd>Pick diagnostic scope="all"<CR>', 'Diagnostic workspace')
nmap_leader('pD', '<Cmd>Pick diagnostic scope="current"<CR>', 'Diagnostic buffer')
nmap_leader('pf', '<Cmd>Pick files<CR>', 'Files')
nmap_leader('pg', '<Cmd>Pick grep_live<CR>', 'Grep live')
nmap_leader('pG', '<Cmd>Pick grep pattern="<cword>"<CR>', 'Grep current word')
nmap_leader('ph', '<Cmd>Pick help<CR>', 'Help tags')
nmap_leader('pH', '<Cmd>Pick hl_groups<CR>', 'Highlight groups')
nmap_leader('pl', '<Cmd>Pick buf_lines scope="all"<CR>', 'Lines (all)')
nmap_leader('pL', '<Cmd>Pick buf_lines scope="current"<CR>', 'Lines (buf)')
nmap_leader('pr', '<Cmd>Pick resume<CR>', 'Resume')
nmap_leader('pR', '<Cmd>Pick lsp scope="references"<CR>', 'References (LSP)')
nmap_leader('ps', pick_workspace_symbols_live, 'Symbols workspace (live)')
nmap_leader('pS', '<Cmd>Pick lsp scope="document_symbol"<CR>', 'Symbols document')
nmap_leader('pv', '<Cmd>Pick visit_paths cwd=""<CR>', 'Visit paths (all)')
nmap_leader('pV', '<Cmd>Pick visit_paths<CR>', 'Visit paths (cwd)')
nmap_leader('f/', '<Cmd>Pick history scope="/"<CR>', '"/" history')
nmap_leader('f:', '<Cmd>Pick history scope=":"<CR>', '":" history')
nmap_leader('<space>', '<Cmd>Pick buffers<CR>', 'Buffers')
nmap_leader('w', '<Cmd>w!<CR>', 'Write buffer')
nmap_leader('fd', '<Cmd>Pick diagnostic scope="all"<CR>', 'Diagnostic workspace')
nmap_leader('fD', '<Cmd>Pick diagnostic scope="current"<CR>', 'Diagnostic buffer')
nmap_leader('ff', '<Cmd>Pick files<CR>', 'Files')
nmap_leader('fg', '<Cmd>Pick grep_live<CR>', 'Grep live')
nmap_leader('fG', '<Cmd>Pick grep pattern="<cword>"<CR>', 'Grep current word')
nmap_leader('fh', '<Cmd>Pick help<CR>', 'Help tags')
nmap_leader('fH', '<Cmd>Pick hl_groups<CR>', 'Highlight groups')
nmap_leader('fl', '<Cmd>Pick buf_lines scope="all"<CR>', 'Lines (all)')
nmap_leader('fL', '<Cmd>Pick buf_lines scope="current"<CR>', 'Lines (buf)')
nmap_leader('fr', '<Cmd>Pick resume<CR>', 'Resume')
nmap_leader('fR', '<Cmd>Pick lsp scope="references"<CR>', 'References (LSP)')
nmap_leader('fs', pick_workspace_symbols_live, 'Symbols workspace (live)')
nmap_leader('fS', '<Cmd>Pick lsp scope="document_symbol"<CR>', 'Symbols document')
-- g is for Git
nmap_leader('gg', '<Cmd>Neogit<CR>', 'Open neogit')
@@ -152,39 +137,30 @@ nmap_leader('gb', '<Cmd>Gitsigns toggle_current_line_blame<CR>', 'Git blame')
-- - `<Leader>ld` - show more diagnostic details in a floating window
-- - `<Leader>lr` - perform rename via LSP
-- - `<Leader>ls` - navigate to source definition of symbol under cursor
--
-- NOTE: most LSP mappings represent a more structured way of replacing built-in
-- LSP mappings (like `:h gra` and others). This is needed because `gr` is mapped
-- by an "replace" operator in 'mini.operators' (which is more commonly used).
local formatting_cmd = '<Cmd>lua require("conform").format({lsp_fallback=true})<CR>'
nmap_leader('la', '<Cmd>lua vim.lsp.buf.code_action()<CR>', 'Actions')
nmap_leader('ld', '<Cmd>lua vim.diagnostic.open_float()<CR>', 'Diagnostic popup')
nmap_leader('lf', formatting_cmd, 'Format')
nmap_leader('li', '<Cmd>lua vim.lsp.buf.implementation()<CR>', 'Implementation')
nmap_leader('lh', '<Cmd>lua vim.lsp.buf.hover()<CR>', 'Hover')
nmap_leader('lr', '<Cmd>lua vim.lsp.buf.rename()<CR>', 'Rename')
nmap_leader('lR', '<Cmd>lua vim.lsp.buf.references()<CR>', 'References')
nmap_leader('ls', '<Cmd>lua vim.lsp.buf.definition()<CR>', 'Source definition')
nmap_leader('la', '<Cmd>lua vim.lsp.buf.code_action()<CR>', 'Actions')
nmap_leader('ld', '<Cmd>lua vim.diagnostic.open_float()<CR>', 'Diagnostic popup')
nmap_leader('lf', '<Cmd>lua vim.lsp.buf.format()<CR>', 'Format')
nmap_leader('li', '<Cmd>lua vim.lsp.buf.implementation()<CR>', 'Implementation')
nmap_leader('lh', '<Cmd>lua vim.lsp.buf.hover()<CR>', 'Hover')
nmap_leader('lr', '<Cmd>lua vim.lsp.buf.rename()<CR>', 'Rename')
nmap_leader('lR', '<Cmd>lua vim.lsp.buf.references()<CR>', 'References')
nmap_leader('ls', '<Cmd>lua vim.lsp.buf.definition()<CR>', 'Source definition')
nmap_leader('lt', '<Cmd>lua vim.lsp.buf.type_definition()<CR>', 'Type definition')
xmap_leader('lf', formatting_cmd, 'Format selection')
-- d is for DAP Debugging
nmap_leader('dd', '<Cmd>DapViewToggle<CR>', 'Open DAP')
nmap_leader('ds', '<Cmd:>DapContinue<CR>', 'Start or Continue')
nmap_leader('db', '<Cmd:>DapToggleBreakpoint<CR>', 'Toggle Breakpoint')
nmap_leader('di', '<Cmd:>DapStepInto<CR>', 'Toggle Breakpoint')
nmap_leader('db', '<Cmd:>DapToggleBreakpoint<CR>', 'Toggle Breakpoint')
-- o is for 'Other'. Common usage:
-- - `<Leader>oz` - toggle between "zoomed" and regular view of current buffer
nmap_leader('or', '<Cmd>lua MiniMisc.resize_window()<CR>', 'Resize to default width')
nmap_leader('ot', '<Cmd>lua MiniTrailspace.trim()<CR>', 'Trim trailspace')
nmap_leader('oz', '<Cmd>lua MiniMisc.zoom()<CR>', 'Zoom toggle')
nmap_leader('om', '<Cmd>Mason<CR>', 'Open Mason')
nmap_leader('ou', '<Cmd>DepsUpdate<CR>', 'Update plugins')
-- z if for notes and todos
nmap_leader('zz', "<Cmd>ZkNotes {sort={'modified'}}<CR>", 'Notes picker')
nmap_leader('zn', "<Cmd>ZkNew {title = vim.fn.input('Title: ')}<CR>", 'New note')
nmap_leader('zt', "<Cmd>ZkTags<CR>", 'Notes tags')
nmap_leader('zf', "<Cmd>ZkNotes {sort={'modified'}, match={vim.fn.input('Search: ')}}<CR>", 'Search')
vmap_leader('zm', "<Cmd>'<,'>ZkMatch<CR>", "Search match")
nmap_leader('zt', "<Cmd>e ~/notes/TODO.md<CR>", "Open TODOs")
nmap_leader('ot', '<Cmd>lua MiniTrailspace.trim()<CR>', 'Trim trailspace')
nmap_leader('oz', '<Cmd>lua MiniMisc.zoom()<CR>', 'Zoom toggle')
nmap_leader('om', '<Cmd>Mason<CR>', 'Open Mason')
nmap_leader('ou', '<Cmd>DepsUpdate<CR>', 'Update plugins')
nmap_leader('or', '<Cmd>Pick registers<CR>', 'Yank from register')
-- stylua: ignore end