jh8fbq
Last Updated: February 25, 2016
·
1.281K
· wkjagt
Ccc9abdf9963f3452808cff0e77679a1

vim pasting without making a mess

vim

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
Say Thanks
Respond

2 Responses
Add your response

8075
Me

Or you can use gp instead p.

over 1 year ago ·
8337
B7aaf37de0dd4c9384d15a61995f6b27

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 ·