nvim icon indicating copy to clipboard operation
nvim copied to clipboard

Throwing `<++>` to the black hole register would be nice

Open tanloong opened this issue 3 years ago • 0 comments

When jumping to the next placeholder, the c command in the keybinding will by default fill the unamed register " with <++>. This causes loss of the original text in " and therefore has a side effect: After jumping, pressing p in normal mode gives <++> instead of the one you want to paste.

The above problem can be avoided by using the black hole register _.

original keybinding: noremap <LEADER><LEADER> <Esc>/<++><CR>:nohlsearch<CR>c4l new keybinding: noremap <LEADER><LEADER> <Esc>/<++><CR>:nohlsearch<CR>"_c4l

tanloong avatar Aug 09 '22 16:08 tanloong