summaryrefslogtreecommitdiffstats
path: root/ftplugin
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-12-30 12:16:03 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2020-12-30 12:16:03 +0100
commit0626cc90a21dbd93806e431a4cff640d2d13c765 (patch)
tree0d34c8341fd4448131b77a36fc3ee64c998c40ee /ftplugin
parent8af4f8e6c04b163d39de4327fca7f69cce78c0ab (diff)
downloadvim-polyglot-4.17.0.tar.gz
vim-polyglot-4.17.0.zip
Change fish provider, closes #626v4.17.0
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/fish.vim31
1 files changed, 29 insertions, 2 deletions
diff --git a/ftplugin/fish.vim b/ftplugin/fish.vim
index d08222db..19fa5c38 100644
--- a/ftplugin/fish.vim
+++ b/ftplugin/fish.vim
@@ -2,6 +2,14 @@ if has_key(g:polyglot_is_disabled, 'fish')
finish
endif
+if exists('b:did_ftplugin')
+ finish
+end
+let b:did_ftplugin = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
setlocal comments=:#
setlocal commentstring=#%s
setlocal define=\\v^\\s*function>
@@ -9,6 +17,7 @@ setlocal foldexpr=fish#Fold()
setlocal formatoptions+=ron1
setlocal formatoptions-=t
setlocal include=\\v^\\s*\\.>
+setlocal iskeyword=@,48-57,-,_,.
setlocal suffixesadd^=.fish
" Use the 'j' format option when available.
@@ -34,9 +43,27 @@ endif
" argument to fish instead of man.
execute 'setlocal keywordprg=fish\ '.fnameescape(expand('<sfile>:p:h:h').'/bin/man.fish')
-let b:match_words =
- \ escape('<%(begin|function|if|switch|while|for)>:<end>', '<>%|)')
+let b:match_ignorecase = 0
+if has('patch-7.3.1037')
+ let s:if = '%(else\s\+)\@15<!if'
+else
+ let s:if = '%(else\s\+)\@<!if'
+endif
+
+let b:match_words = escape(
+ \'<%(begin|function|'.s:if.'|switch|while|for)>:<else\s\+if|case>:<else>:<end>'
+ \, '<>%|)')
let b:endwise_addition = 'end'
let b:endwise_words = 'begin,function,if,switch,while,for'
let b:endwise_syngroups = 'fishKeyword,fishConditional,fishRepeat'
+
+let b:undo_ftplugin = "
+ \ setlocal comments< commentstring< define< foldexpr< formatoptions<
+ \|setlocal include< iskeyword< suffixesadd<
+ \|setlocal formatexpr< omnifunc< path< keywordprg<
+ \|unlet! b:match_words b:endwise_addition b:endwise_words b:endwise_syngroups
+ \"
+
+let &cpo = s:save_cpo
+unlet s:save_cpo