Where developers come to connect, share, build and be inspired.

10

VimTip#1: paste without escape

2116 views

Long time ago I found a binding:

imap <C-v> <esc>"+pi

... and added it to my vimrc.

Don't do it. It's useless and wrong.

You can achieve the same with native

<C-r>{register}

binding, which allows you to paste from any register when you are in insert mode.

So, while being in insert mode, instead:

<C-v>

you can use:

<C-r>"

to paste from global register. Or

<C-r>+

to paste from system drop register. Or

<C-r>*

from system select register (only unix/linux) or use any named register as you like.

edit:

You can find more tips like this in the awesome Practical Vim book by Drew Neil http://pragprog.com/book/dnvim/practical-vim

Comments

Add a comment