From 7a3aa50d7fb712eb17a68b8c6626c65be80e4d48 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Fri, 17 Apr 2026 10:53:54 +0100 Subject: refactor: audit and fix neovim keybinds - fix visual p register clobbering: use "_dP black-hole pattern - remove ; -> : mapping: restore native repeat-find motion - remove / -> ^/$ emacs mappings: anti-vim-philosophy - map dial.nvim to //g/g (standard increment keys) - remove redundant oq diagnostic loclist (covered by tl) - collapse {,v,x,t}D type-def onto g{v,x,t}t pattern (0.12 grt) - move oc/ic calls to co/ci (Code group) - add gvr/gxr/gtr for references in splits - remove empty s and d which-key group declarations --- home/.config/nvim/lua/config/keymaps.lua | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'home/.config/nvim/lua/config') 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("", "nohlsearch") --- make an accidental ; press also enter command mode -nmap(";", ":") - -- highlight last inserted text nmap("gV", "`[v`]") nmap("", "") nmap("", "") --- go to first non-blank character of current line -nvmap("", "^") -nvmap("", "$") - --- 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 == '"'let @@=@0endif") -vmap("p", 'p:let @+=@0:let @"=@0') +-- paste over selection without clobbering registers +vmap("p", '"_dP') -- Find and Replace binds ncmdi("s", "%s/") @@ -89,12 +77,6 @@ nmap("]e", function() }) end) -nmap( - "oq", - vim.diagnostic.setloclist, - "[O]pen diagnostic [Q]uickfix list" -) - nmap("yp", function() vim.fn.setreg("+", vim.fn.expand("%")) end, "[Y]ank [P]ath") -- cgit v1.2.3-70-g09d2