From a49e49bbd490eb2d44fd0705d266e3200c3173cf Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 7 Mar 2022 22:02:06 +0100 Subject: [PATCH] nvim: Change path copy mapping Changed mapping to copy path from `yf` to `yp`/`yP`. Two reasons: I might be better able to remember 'yank-path' when saying it in my head as a mnemonic, and with the `yf` mapping set I could only yank things *to* some letter `yt` not including some letter `yf` and it has been very subtly annoying me ever since I introduced the mapping. Fixed now. Also added two variations: `yp` will yank the whole path into the `p` register, and `yP` will only yank the filename itself. Here's to remembering the new mapping! --- nvim/.config/nvim/lua/maps.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nvim/.config/nvim/lua/maps.lua b/nvim/.config/nvim/lua/maps.lua index d4ee163..6f99ae9 100644 --- a/nvim/.config/nvim/lua/maps.lua +++ b/nvim/.config/nvim/lua/maps.lua @@ -56,8 +56,9 @@ map.i.nore[''] = 'guiw`]a' map.c.nore['w!!'] = [[execute 'silent! write !sudo tee % >/dev/null' edit!]] --- yank filename to f buffer -map.n.nore['yf'] = ':let @f = expand("%")' +-- yank current filename/filepath to f buffer +map.n.nore['yp'] = ':let @p = expand("%")' +map.n.nore['yP'] = ':let @p = expand("%:p")' -- repeat the last substitute command with all its flags preserved map.n.nore['&'] = ':&&'