http://qs321.pair.com?node_id=540302


in reply to .vimrc for perl programmers

If you want to turn on 'paste' mode while already in 'insert' mode you need a couple of extra mappings. Here is what I have (note that I have mapped F7 and F8 instead of just F11 which you were using):

:map <F7> :set paste<CR> :map <F8> :set nopaste<CR> :imap <F7> <C-O>:set paste<CR> :imap <F8> <nop> :set pastetoggle=<F8>

Now you can hit F8 at any time to switch to paste mode.