aboutsummaryrefslogtreecommitdiff
path: root/autoload/shebang_change_filetype.vim
blob: 081eaf186c6af8719fb90d9ddee137f6601c1bb4 (plain) (blame)
1
2
3
4
5
6
7
" Check whether the first line was changed and looks like a shebang, and if
" so, re-run filetype detection
function! shebang_change_filetype#Check() abort
  if line('''[') == 1 && getline(1) =~# '^#!'
    doautocmd filetypedetect BufRead
  endif
endfunction