diff options
Diffstat (limited to 'vim/filetype.vim')
-rw-r--r-- | vim/filetype.vim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/vim/filetype.vim b/vim/filetype.vim index 440ee6e1..89ee5b7d 100644 --- a/vim/filetype.vim +++ b/vim/filetype.vim @@ -42,7 +42,8 @@ function! s:StripRepeat() endfunction -" Check if the first line is a shebang +" Check whether the first line was changed and looks like a shebang, and if +" so, re-run filetype detection function! s:CheckShebang() if line('''[') == 1 && stridx(getline(1), '#!') == 0 doautocmd filetypedetect BufRead @@ -517,8 +518,9 @@ augroup filetypedetect \| runtime scripts.vim \|endif - " If supported, on leaving insert mode, check whether the first line was " - " changed and is a shebang format, and if so, re-run filetype detection + " If supported, on leaving insert mode, check whether the first line was + " changed and looks like a shebang format, and if so, re-run filetype + " detection if v:version > 700 autocmd InsertLeave * call s:CheckShebang() endif |