use fish's man function for &keywordprg

This makes it possible to use K to view the man page for the fish
builtin under the cursor.
This commit is contained in:
Dag Odenhall 2013-05-14 13:29:26 +02:00
parent cd9c3cb930
commit 97e6b0b060
3 changed files with 9 additions and 3 deletions

View file

@ -3,9 +3,9 @@ vim-fish
This is an addon for Vim providing filetype support for [fish][] scripts. In
addition to the normal Vim features such as syntax highlighting, automatic
indentation, reformatting and filetype detection, this addon includes support
for the third-party addons [UltiSnips][], [Syntastic][], [endwise][] and
[commentary][] when any of those are installed.
indentation, reformatting, keyword lookup and filetype detection, this addon
includes support for the third-party addons [UltiSnips][], [Syntastic][],
[endwise][] and [commentary][] when any of those are installed.
Bonus feature: if you use Vim with `funced` in fish, Vim will enter Insert mode
at the end of the last line inside the function, after indenting it once if

1
bin/man.fish Executable file
View file

@ -0,0 +1 @@
man $argv

View file

@ -2,6 +2,11 @@ setlocal commentstring=#%s
setlocal iskeyword=@,48-57,-,_,.,/
setlocal formatprg=fish_indent
" 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\ '.expand('<sfile>:p:h:h').'/bin/man.fish'
let b:endwise_addition = 'end'
let b:endwise_words = 'begin,function,if,switch,while,for'
let b:endwise_syngroups = 'fishKeyword,fishConditional,fishRepeat'