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 runtime! ftplugin/programming_lang.vim
21 setlocal keywordprg=pydoc
25 autocmd BufWritePost <buffer> call SavePython()
28 " Compile and remove *.cgi[co] files after compilation; do not remove *.py[co] files;
29 " if it is a shebang script change file mode to make it executable.
30 function! SavePython()
31 let ext = expand("%:e")
41 if getline(1) =~ "^#!"
42 call SetExecutableBit(1)
47 " Avoid double indent. See https://stackoverflow.com/a/62348570/7976758
48 let g:pyindent_open_paren=shiftwidth()