Partially import github.com/dag/vim-fish
This commit is contained in:
parent
819a3b7c2e
commit
bb3ef358ee
4 changed files with 129 additions and 0 deletions
23
vim/ftdetect/fish.vim
Normal file
23
vim/ftdetect/fish.vim
Normal file
|
@ -0,0 +1,23 @@
|
|||
autocmd BufRead,BufNewFile *.fish setfiletype fish
|
||||
|
||||
" Detect fish scripts by the shebang line.
|
||||
autocmd BufRead *
|
||||
\ if getline(1) =~# '\v^#!%(\f*/|/usr/bin/env\s*<)fish>' |
|
||||
\ setlocal filetype=fish |
|
||||
\ endif
|
||||
|
||||
" Move cursor to first empty line when using funced.
|
||||
autocmd BufRead fish_funced_*_*.fish call search('^$')
|
||||
|
||||
" Fish histories are YAML documents.
|
||||
autocmd BufRead,BufNewFile ~/.config/fish/fish_{read_,}history setfiletype yaml
|
||||
|
||||
" Universal variable storages should not be hand edited.
|
||||
autocmd BufRead,BufNewFile ~/.config/fish/fishd.* setlocal readonly
|
||||
|
||||
" Mimic `funced` when manually creating functions.
|
||||
autocmd BufNewFile ~/.config/fish/functions/*.fish
|
||||
\ call append(0, ['function '.expand('%:t:r'),
|
||||
\'',
|
||||
\'end']) |
|
||||
\ 2
|
Loading…
Add table
Add a link
Reference in a new issue