jh8fbq
Last Updated: February 25, 2016
·
1.296K
· wkjagt

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

2 Responses
Add your response

8075

Or you can use gp instead p.

over 1 year ago ·
8337

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 ·