Remapping x, X and Del in Vim to Not Overwrite Your Clipboard
A few remappings that let you delete characters or a selection of characters, although it does change the default behavior of Vim.
Quick Jump: Demo Video
Deleting 1 or more characters without wanting them to overwrite what’s in my clipboard is something I do many times a day. It’s pretty easy to remap what Vim provides by default to do this. This 3 minute video shows how it works and how to do it.
noremap x "_x noremap X "_x noremap <Del> "_x
- 0:09 – Going over how the remappings work in Vim
- 0:56 – Checking out the remappings in Vim
- 2:02 – The remappings work with visual selection mode too
- 2:19 – This does change a default behavior of Vim
Are you going to use these remappings in your vimrc? Let me know below.