Python: My .vimrc

This is especially for working with Python. I welcome additions or better practises!

set term=builtin_ansi

syntax on

autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class

autocmd BufRead *.py inoremap # X^H#

autocmd BufRead *.py set tabstop=4

autocmd BufRead *.py set shiftwidth=4

autocmd BufRead *.py set smarttab

autocmd BufRead *.py set expandtab

autocmd BufRead *.py set softtabstop=4

autocmd BufRead *.py set autoindent

autocmd BufRead *.py highlight BadWhitespace ctermbg=red guibg=red

autocmd BufRead *.py match BadWhitespace /^\t+/

autocmd BufRead *.py match BadWhitespace /\s+$/

(The ^H is typed by Ctrl+V Ctrl+H.)

Comments

Comments powered by Disqus