aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLibravatar sommerfeld <[email protected]>2026-04-17 10:53:54 +0100
committerLibravatar sommerfeld <[email protected]>2026-04-17 10:53:54 +0100
commit7a3aa50d7fb712eb17a68b8c6626c65be80e4d48 (patch)
treec9e9cafb250b17fbfeea7cbe40821049e07b3460
parenteb036339bccb2ed58217c808152fee8a99963909 (diff)
downloaddotfiles-7a3aa50d7fb712eb17a68b8c6626c65be80e4d48.tar.gz
dotfiles-7a3aa50d7fb712eb17a68b8c6626c65be80e4d48.tar.bz2
dotfiles-7a3aa50d7fb712eb17a68b8c6626c65be80e4d48.zip
refactor: audit and fix neovim keybinds
- fix visual p register clobbering: use "_dP black-hole pattern - remove ; -> : mapping: restore native repeat-find motion - remove <C-a>/<C-e> -> ^/$ emacs mappings: anti-vim-philosophy - map dial.nvim to <C-a>/<C-x>/g<C-a>/g<C-x> (standard increment keys) - remove redundant <leader>oq diagnostic loclist (covered by <leader>tl) - collapse <leader>{,v,x,t}D type-def onto g{v,x,t}t pattern (0.12 grt) - move <leader>oc/<leader>ic calls to <leader>co/<leader>ci (Code group) - add gvr/gxr/gtr for references in splits - remove empty <leader>s and <leader>d which-key group declarations
-rw-r--r--home/.config/nvim/lua/config/keymaps.lua22
-rw-r--r--home/.config/nvim/lua/plugins/editing.lua16
-rw-r--r--home/.config/nvim/lua/plugins/init.lua2
-rw-r--r--home/.config/nvim/lua/plugins/lsp.lua26
4 files changed, 30 insertions, 36 deletions
diff --git a/home/.config/nvim/lua/config/keymaps.lua b/home/.config/nvim/lua/config/keymaps.lua
index 349fc96..366a37e 100644
--- a/home/.config/nvim/lua/config/keymaps.lua
+++ b/home/.config/nvim/lua/config/keymaps.lua
@@ -28,26 +28,14 @@ end
ncmd("<esc>", "nohlsearch")
--- make an accidental ; press also enter command mode
-nmap(";", ":")
-
-- highlight last inserted text
nmap("gV", "`[v`]")
nmap("<down>", "<c-e>")
nmap("<up>", "<c-y>")
--- go to first non-blank character of current line
-nvmap("<c-a>", "^")
-nvmap("<c-e>", "$")
-
--- This extends p in visual mode (note the noremap), so that if you paste from
--- the unnamed (ie. default) register, that register content is not replaced by
--- the visual selection you just pasted over–which is the default behavior.
--- This enables the user to yank some text and paste it over several places in
--- a row, without using a named register
--- map.v('p', "p:if v:register == '"'<Bar>let @@=@0<Bar>endif<cr>")
-vmap("p", 'p:let @+=@0<CR>:let @"=@0<CR>')
+-- paste over selection without clobbering registers
+vmap("p", '"_dP')
-- Find and Replace binds
ncmdi("<localleader>s", "%s/")
@@ -89,12 +77,6 @@ nmap("]e", function()
})
end)
-nmap(
- "<leader>oq",
- vim.diagnostic.setloclist,
- "[O]pen diagnostic [Q]uickfix list"
-)
-
nmap("yp", function()
vim.fn.setreg("+", vim.fn.expand("%"))
end, "[Y]ank [P]ath")
diff --git a/home/.config/nvim/lua/plugins/editing.lua b/home/.config/nvim/lua/plugins/editing.lua
index bcbfc6f..5175516 100644
--- a/home/.config/nvim/lua/plugins/editing.lua
+++ b/home/.config/nvim/lua/plugins/editing.lua
@@ -6,19 +6,25 @@ require("various-textobjs").setup({
},
})
--- dial.nvim keymaps
-vim.keymap.set("n", "]i", function()
+-- dial.nvim: enhanced increment/decrement on standard vim keys
+vim.keymap.set("n", "<C-a>", function()
return require("dial.map").inc_normal()
end, { expr = true, desc = "Increment" })
-vim.keymap.set("n", "[i", function()
+vim.keymap.set("n", "<C-x>", function()
return require("dial.map").dec_normal()
end, { expr = true, desc = "Decrement" })
-vim.keymap.set("v", "]i", function()
+vim.keymap.set("v", "<C-a>", function()
return require("dial.map").inc_visual()
end, { expr = true, desc = "Increment" })
-vim.keymap.set("v", "[i", function()
+vim.keymap.set("v", "<C-x>", function()
return require("dial.map").dec_visual()
end, { expr = true, desc = "Decrement" })
+vim.keymap.set("v", "g<C-a>", function()
+ return require("dial.map").inc_gvisual()
+end, { expr = true, desc = "Increment (sequential)" })
+vim.keymap.set("v", "g<C-x>", function()
+ return require("dial.map").dec_gvisual()
+end, { expr = true, desc = "Decrement (sequential)" })
-- refactoring.nvim
require("refactoring").setup({})
diff --git a/home/.config/nvim/lua/plugins/init.lua b/home/.config/nvim/lua/plugins/init.lua
index a0a6d49..b106b6e 100644
--- a/home/.config/nvim/lua/plugins/init.lua
+++ b/home/.config/nvim/lua/plugins/init.lua
@@ -12,12 +12,10 @@ require("which-key").setup({
{ "]", group = "Navigate to next" },
{ "[", group = "Navigate to previous" },
{ "<leader>c", group = "[C]ode", mode = { "n", "x" } },
- { "<leader>d", group = "[D]ocument" },
{ "<leader>g", group = "[G]it" },
{ "<leader>h", group = "Git [H]unk", mode = { "n", "v" } },
{ "<leader>o", group = "[O]verseer" },
{ "<leader>r", group = "[R]efactor" },
- { "<leader>s", group = "[S]earch" },
{ "<leader>w", group = "[W]orkspace" },
{ "<leader>t", group = "[T]oggle" },
},
diff --git a/home/.config/nvim/lua/plugins/lsp.lua b/home/.config/nvim/lua/plugins/lsp.lua
index 2e334c8..ddd5bea 100644
--- a/home/.config/nvim/lua/plugins/lsp.lua
+++ b/home/.config/nvim/lua/plugins/lsp.lua
@@ -88,16 +88,15 @@ vim.api.nvim_create_autocmd("LspAttach", {
nmap("gtd", function()
fzf.lsp_definitions({ jump1_action = fzf.actions.file_tabedit })
end, "[G]oto in a [T]ab to [D]efinition")
- nmap("<leader>D", fzf.lsp_typedefs, "Type [D]efinition")
- nmap("<leader>vD", function()
+ nmap("gvt", function()
fzf.lsp_typedefs({ jump1_action = fzf.actions.file_vsplit })
- end, "Open in a [V]ertical split Type [D]efinition")
- nmap("<leader>xD", function()
+ end, "[G]oto in a [V]ertical split to [T]ype definition")
+ nmap("gxt", function()
fzf.lsp_typedefs({ jump1_action = fzf.actions.file_split })
- end, "Open in a [X]horizontal split Type [D]efinition")
- nmap("<leader>tD", function()
+ end, "[G]oto in a [X]horizontal split to [T]ype definition")
+ nmap("gtt", function()
fzf.lsp_typedefs({ jump1_action = fzf.actions.file_tabedit })
- end, "Open in a [T]ab Type [D]efinition")
+ end, "[G]oto in a [T]ab to [T]ype definition")
nmap("gri", fzf.lsp_implementations, "[G]oto [I]mplementation")
nmap("grvi", function()
fzf.lsp_implementations({ jump1_action = fzf.actions.file_vsplit })
@@ -109,8 +108,17 @@ vim.api.nvim_create_autocmd("LspAttach", {
fzf.lsp_implementations({ jump1_action = fzf.actions.file_tabedit })
end, "[G]oto in a [T]ab to [I]mplementation")
nmap("grr", fzf.lsp_references, "[G]oto [R]eferences")
- nmap("<leader>ic", fzf.lsp_incoming_calls, "[I]ncoming [C]alls")
- nmap("<leader>oc", fzf.lsp_outgoing_calls, "[O]utgoing [C]alls")
+ nmap("gvr", function()
+ fzf.lsp_references({ jump1_action = fzf.actions.file_vsplit })
+ end, "[G]oto in a [V]ertical split to [R]eferences")
+ nmap("gxr", function()
+ fzf.lsp_references({ jump1_action = fzf.actions.file_split })
+ end, "[G]oto in a [X]horizontal split to [R]eferences")
+ nmap("gtr", function()
+ fzf.lsp_references({ jump1_action = fzf.actions.file_tabedit })
+ end, "[G]oto in a [T]ab to [R]eferences")
+ nmap("<leader>ci", fzf.lsp_incoming_calls, "[C]ode [I]ncoming calls")
+ nmap("<leader>co", fzf.lsp_outgoing_calls, "[C]ode [O]utgoing calls")
nmap("gO", fzf.lsp_document_symbols, "d[O]ocument symbols")
nmap(
"<leader>ws",