X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.vim%2Fftplugin%2Fpython.vim;h=95333e6f57c50e17a8768bff14d08f1cdc99be45;hb=c364b5ed17d13c0ed3d21a82e1c3c92f154ae592;hp=44ec35e0775cc24159e0afe9c385039ccf38b8bd;hpb=f46bd4d41cc7f243bc8a321effee5200aa69e709;p=dotfiles.git diff --git a/.vim/ftplugin/python.vim b/.vim/ftplugin/python.vim index 44ec35e..95333e6 100644 --- a/.vim/ftplugin/python.vim +++ b/.vim/ftplugin/python.vim @@ -17,13 +17,13 @@ if has("iconv") && !exists('b:encoding_set') endif endif -setlocal fo-=t fo+=croql +setlocal formatoptions-=t formatoptions+=croql setlocal keywordprg=pydoc setlocal shiftwidth=4 softtabstop=4 compiler python if has("unix") - execute "autocmd BufWritePost " . expand("%") . " call SavePython()" + autocmd BufWritePost call SavePython() endif " Compile and remove *.cgi[co] files after compilation; do not remove *.py[co] files; @@ -32,7 +32,7 @@ function! SavePython() let ext = expand("%:e") if ext == "pyem" return - elif ext == "ptl" + elseif ext == "ptl" !compyle-ptl % else !compyle % @@ -40,7 +40,7 @@ function! SavePython() !rm -f %[co] endif if getline(1) =~ "^#!" - !chmod +x % + call SetExecutableBit(1) endif endif endfunction