Take the 2-minute tour ×

I do "set:paste"

That will allow me to paste text into putty very nicely.

However, my "smart indents" and 'auto tabbing' --which is in my original config..is gone!?

How do I make it so that

  1. I don't have to do "set: paste" everytime I want to paste something and
  2. if I do have to do that...I can easily go back to normal config?
set nohlsearch
set ai
set bg=dark
set showmatch
highlight SpecialKey ctermfg=DarkGray
set listchars=tab:>-,trail:~
set list
autocmd BufEnter,BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
set tabstop=4
set shiftwidth=4
set expandtab
set autoindent
set smartindent
syntax on
set listchars=tab:>-
set listchars+=trail:.
set ignorecase
set smartcase
map  :tabr
map  :tabl
map  :tabp
map  :tabn
filetype indent on
filetype on
filetype plugin on
share|improve this question
Please format the code in your question. –  Andrey Vlasovskikh Oct 14 '09 at 1:52

3 Answers 3

up vote 3 down vote accepted

You might want to:

set pastetoggle=<F6>

With this you can change paste status with F6 (you can of course bind it to anything you want.

share|improve this answer

for 2. :set nopaste

share|improve this answer
or you can toggle using :set paste! –  rampion Oct 16 '09 at 1:50

If you can use any of the graphical versions of vim (eg gvim, macvim) then they usually have support for copy and paste that doesn't require :set paste.

share|improve this answer
I usually do "vim filename" . But when I paste it becomes like a pyramid..? –  TIMEX Oct 14 '09 at 19:58
it sounds like you're using the terminal-based version of vim. you need gvim or macvim to make this work. –  Peter Oct 14 '09 at 20:49

Your Answer


