vim pasting without making a mess
If you have auto-indenting enabled in vim, you probably know what a mess you get when you paste a block of code in it. Luckily, vim has something called paste mode :
- before pasting :
:set paste
- after pasting :
:set nopaste
Written by Willem van der Jagt
Related protips
2 Responses
Or you can use gp
instead p
.
over 1 year ago
·
don't forget to set this on a key in your .vimrc
:
set pastetoggle=<F2>
(http://vim.wikia.com/wiki/Toggle_auto-indenting_for_code_paste)
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Related Tags
#vim
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#