setlocal tabstop=4 setlocal softtabstop=4 setlocal shiftwidth=4 setlocal expandtab setlocal autoindent setlocal smartindent setlocal cinwords=if,elif,else,for,while,try,except,finally,def,class if !exists("stripwhitespace_autocommand") let stripwhitespace_autocommand = 1 aug stripwhitespace autocmd stripwhitespace BufWritePre %s/\s\+$//e endif