News for hackers. Stuff that matters.
Re:Pasting Text Into Vim by nsheridan on Thursday July 26, 2012 @05:59AM (#4295241)
My .vimrc contains: set pastetoggle=<F2>

Life is suddenly easier :)

Re:Pasting Text Into Vim by tux1968 on Thursday July 26, 2012 @07:14AM (#4295416)
My .vimrc contains :

set pastetoggle=<Esc>[201~

noremap <Esc>[200~ :set paste<cr>0i

inoremap <Esc>[200~ <c-o>:set paste<cr>

cnoremap <special> <Esc>[200~ <nop>

cnoremap <special> <Esc>[201~ <nop>

let &t_ti="\<esc>[?2004h"

let &t_te="\<esc>[?2004l"

the ti/te sequences are passed from Vim to the client which tells Putty (and others) to bracket all pasting with \e[200~ and \e[201~. The other commands handle these sequences to make pasting happen transparently without having to hit F2 ;o)