Unix – I have a vim config. However, when I paste text

unixvim

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

Best Answer

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.