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<letter>` not including some letter
`yf<letter>` 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!
This commit is contained in:
Marty Oehme 2022-03-07 22:02:06 +01:00
parent 9a1efff30c
commit a49e49bbd4
Signed by: Marty
GPG key ID: B7538B8F50A1C800

View file

@ -56,8 +56,9 @@ map.i.nore['<C-l>'] = '<esc>guiw`]a'
map.c.nore['w!!'] =
[[execute 'silent! write !sudo tee % >/dev/null' <bar> edit!]]
-- yank filename to f buffer
map.n.nore['yf'] = ':let @f = expand("%")<cr>'
-- yank current filename/filepath to f buffer
map.n.nore['yp'] = ':let @p = expand("%")<Cr>'
map.n.nore['yP'] = ':let @p = expand("%:p")<Cr>'
-- repeat the last substitute command with all its flags preserved
map.n.nore['&'] = ':&&<cr>'