summaryrefslogtreecommitdiffstats
path: root/ftplugin/fish.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2017-12-06 13:17:06 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2017-12-06 13:17:06 +0100
commit11f53253ad9fd0cd3e7a44ed9f8c80a4f265b46e (patch)
tree08649366f6babad66db065b341691cfac02c2c4a /ftplugin/fish.vim
parent9fe009095afdb86f6f771109ac454ccfc5340f31 (diff)
downloadvim-polyglot-3.2.0.tar.gz
vim-polyglot-3.2.0.zip
Add slime syntax, closes #252v3.2.0
Diffstat (limited to 'ftplugin/fish.vim')
-rw-r--r--ftplugin/fish.vim43
1 files changed, 43 insertions, 0 deletions
diff --git a/ftplugin/fish.vim b/ftplugin/fish.vim
new file mode 100644
index 00000000..c6c1f6d8
--- /dev/null
+++ b/ftplugin/fish.vim
@@ -0,0 +1,43 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fish') == -1
+
+setlocal comments=:#
+setlocal commentstring=#%s
+setlocal define=\\v^\\s*function>
+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.
+if v:version ># 703 || v:version ==# 703 && has('patch541')
+ setlocal formatoptions+=j
+endif
+
+if executable('fish_indent')
+ setlocal formatexpr=fish#Format()
+endif
+
+if executable('fish')
+ setlocal omnifunc=fish#Complete
+ for s:path in split(system("fish -c 'echo $fish_function_path'"))
+ execute 'setlocal path+='.s:path
+ endfor
+else
+ setlocal omnifunc=syntaxcomplete#Complete
+endif
+
+" Use the 'man' wrapper function in fish to include fish's man pages.
+" Have to use a script for this; 'fish -c man' would make the the man page an
+" 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:endwise_addition = 'end'
+let b:endwise_words = 'begin,function,if,switch,while,for'
+let b:endwise_syngroups = 'fishKeyword,fishConditional,fishRepeat'
+
+endif