aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-21 00:08:48 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-21 00:08:48 +1200
commit5e2bc02e92baa4750a9fe58051f7dec2e285c841 (patch)
treeb8d4deb1848536715c7eef3c89f940640d77bb44 /vim
parentce58bb1e7508553633f5eed0abece72b83321185 (diff)
downloaddotfiles-5e2bc02e92baa4750a9fe58051f7dec2e285c841.tar.gz
Move shebang change filetype hooks into plugin
Diffstat (limited to 'vim')
-rw-r--r--vim/autoload/filetype.vim8
m---------vim/bundle/shebang_change_filetype0
-rw-r--r--vim/filetype.vim6
3 files changed, 0 insertions, 14 deletions
diff --git a/vim/autoload/filetype.vim b/vim/autoload/filetype.vim
index fb70d690..79df3b28 100644
--- a/vim/autoload/filetype.vim
+++ b/vim/autoload/filetype.vim
@@ -64,11 +64,3 @@ function! filetype#SudoRepeat() abort
endif
endfunction
-
-" Check whether the first line was changed and looks like a shebang, and if
-" so, re-run filetype detection
-function! filetype#CheckShebang() abort
- if line('''[') == 1 && getline(1) =~# '^#!'
- doautocmd filetypedetect BufRead
- endif
-endfunction
diff --git a/vim/bundle/shebang_change_filetype b/vim/bundle/shebang_change_filetype
new file mode 160000
+Subproject 961e50bfc2128e04c7771ee0150d9024f561698
diff --git a/vim/filetype.vim b/vim/filetype.vim
index 9d6c6eb7..c5f67db0 100644
--- a/vim/filetype.vim
+++ b/vim/filetype.vim
@@ -513,10 +513,4 @@ augroup filetypedetect
\| runtime scripts.vim
\|endif
- " On leaving insert mode, check whether the first line was changed and looks
- " like a shebang format, and if so, re-run filetype detection
- autocmd InsertLeave
- \ *
- \ call filetype#CheckShebang()
-
augroup END