Learn Docker With My Newest Course

Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →

Remapping x, X and Del in Vim to Not Overwrite Your Clipboard

remapping-x-and-del-in-vim-to-not-overwrite-your-clipboard.jpg

A few remappings that let you delete characters or a selection of characters, although it does change the default behavior of Vim.

Quick Jump:

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.

# Demo Video

Vim Configuration

noremap x "_x
noremap X "_x
noremap <Del> "_x

Timestamps

  • 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

Reference Links

Are you going to use these remappings in your vimrc? Let me know below.

Never Miss a Tip, Trick or Tutorial

Like you, I'm super protective of my inbox, so don't worry about getting spammed. You can expect a few emails per year (at most), and you can 1-click unsubscribe at any time. See what else you'll get too.



Comments