1 if exists("b:did_ftplugin")
5 " Do not set b:did_ftplugin - it prevents standard plugins from running
6 " let b:did_ftplugin = 1 " it will be set in the standard plugin
8 if has("iconv") && !exists('b:encoding_set')
9 " Try to recognize the file encoding and convert the file
11 if line !~ '^ *#.*coding[=:]\s*\([-0-9A-Za-z_.]\+\)'
14 if line =~ '^ *#.*coding[=:]\s*\([-0-9A-Za-z_.]\+\)'
15 let encoding = matchlist(line, 'coding[=:]\s*\([-0-9A-Za-z_.]\+\)')[1]
16 call SetupEncoding(encoding)
20 setlocal formatoptions-=t formatoptions+=croql
21 setlocal keywordprg=pydoc
22 setlocal shiftwidth=4 softtabstop=4
26 execute "autocmd BufWritePost " . expand("%") . " call SavePython()"
29 " Compile and remove *.cgi[co] files after compilation; do not remove *.py[co] files;
30 " if it is a shebang script change file mode to make it executable.
31 function! SavePython()
32 let ext = expand("%:e")
42 if getline(1) =~ "^#!"