Wiki: Paste Indent Problems


<cgreen> trying to cut a paste from shell running VIM to another shell running VIM, indents are all screwed

<morbuz> :set paste

<morbuz> then :set nopaste when you're done

<cgreen> I have tried :set noai but editing python code and need to maintain idents of pasted text

<morbuz> turns off autoindenting and stuff like that


<ar> use :set paste! to toggle and then use the command scrollback buffer


<absolon> I made myself a nice mapping for this. Put the following in your .vimrc, and if you paste and the indentation gets fscked just press C-a.

<absolon> inoremap <silent> <C-a> <ESC>u:set paste<CR>.:set nopaste<CR>gi


Copyright © 2007 RobertMelton.com