forked from dag/vim-fish
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- funced and fish_indent always uses tabs for indentation, use fish#Indent() to fix it. Works better with the improved fish#Indent(). - ftdetect should contain filetype detection code. Move autocmds to plugin/fish.vim. - Match new funced temp file name. - Add "else", "else if" and "case" to b:match_words to follow what's used by Vim's ftplugins. blankname: - dropped the syntax changes (cc: dag#28) Co-authored-by: blankname <>
- Loading branch information
Showing
4 changed files
with
30 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
autocmd BufRead,BufNewFile *.fish setfiletype fish | ||
|
||
" Set filetype when using funced. | ||
autocmd BufRead fish_funced.* setfiletype fish | ||
|
||
" Fish histories are YAML documents. | ||
autocmd BufRead,BufNewFile ~/.config/fish/fish_{read_,}history setfiletype yaml | ||
|
||
" 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 setline(1, ['function '.expand('%:t:r'), '', 'end']) | 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
if get(g:, 'loaded_fish', 0) | ||
finish | ||
endif | ||
let loaded_fish = 1 | ||
|
||
" Universal variable storages should not be hand edited. | ||
autocmd BufRead,BufNewFile ~/.config/fish/fishd.* setlocal readonly | ||
|
||
" Move cursor to first empty line when using funced. | ||
autocmd BufRead fish_funced.* exec "normal! gg=G" | call search('^\s*\zs$') | ||
|
||
" Mimic `funced` when manually creating functions. | ||
autocmd BufNewFile ~/.config/fish/functions/*.fish | ||
\ call setline(1, ['function '.expand('%:t:r'), '', 'end']) | 2 |