aboutsummaryrefslogtreecommitdiff
path: root/vim/plugin/shebang_update.vim
blob: 60031e26d20fcca145d6ff7cab1c7ee802a880d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"
" shebang_update.vim: If the first line of a file was changed, re-run "
" scripts.vim to do shebang detection to update the filetype.
"
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
if exists('g:loaded_shebang_update') || &compatible
  finish
endif
if v:version < 700
  finish
endif
let g:loaded_shebang_update = 1

" Call the update function whenever leaving insert mode
augroup shebang_update
  autocmd!
  autocmd InsertLeave * call shebang#Update()
augroup END