Skip to content

Commit f4432fe

Browse files
committed
detect fish scripts by shebang line
We can't use `:setfiletype` for this because we need to sidestep any filetype set previously by extension, such as `*.sh`.
1 parent 8926f8b commit f4432fe

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ftdetect/fish.vim

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
autocmd BufRead,BufNewFile * if getline(1) =~# '\v^#!\f*/fish>' | setlocal filetype=fish | endif
12
autocmd BufRead,BufNewFile *.fish setfiletype fish
23
autocmd BufRead fish_funced_*_*.fish ?\C^end\>?-1 | if getline('.') ==# '' | execute "normal! i\<C-t>" | endif | startinsert!
34
autocmd BufRead,BufNewFile ~/.config/fish/fish_{read_,}history setfiletype yaml

0 commit comments

Comments
 (0)