Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Don't put character in yank buffer when pressing 'Del'

Tags:

vim

Deleting a character in normal mode with Del places it the yank buffer. How can I change this behavior to keep the buffer unchanged? For example, yank it to the black hole buffer as one can when using the d command?

like image 738
rainer Avatar asked Feb 20 '13 13:02

rainer


1 Answers

You can change the yank buffer with "<character>. The "black hole" buffer is _, so the command you want would be "_d etc. Note that this is per-deletion (yank, etc.).

You can create a simple shortcut in your .vimrc that does this with the Del by default.

nnoremap <Del> "_x
like image 102
Explosion Pills Avatar answered Nov 26 '22 15:11

Explosion Pills