diff --git a/ftplugin/python.vim b/ftplugin/python.vim index e02b570..d7d03aa 100644 --- a/ftplugin/python.vim +++ b/ftplugin/python.vim @@ -5,3 +5,8 @@ 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