Skip to content

Commit 97e6b0b

Browse files
committed
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.
1 parent cd9c3cb commit 97e6b0b

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ vim-fish
33

44
This is an addon for Vim providing filetype support for [fish][] scripts. In
55
addition to the normal Vim features such as syntax highlighting, automatic
6-
indentation, reformatting and filetype detection, this addon includes support
7-
for the third-party addons [UltiSnips][], [Syntastic][], [endwise][] and
8-
[commentary][] when any of those are installed.
6+
indentation, reformatting, keyword lookup and filetype detection, this addon
7+
includes support for the third-party addons [UltiSnips][], [Syntastic][],
8+
[endwise][] and [commentary][] when any of those are installed.
99

1010
Bonus feature: if you use Vim with `funced` in fish, Vim will enter Insert mode
1111
at the end of the last line inside the function, after indenting it once if

bin/man.fish

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
man $argv

ftplugin/fish.vim

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ setlocal commentstring=#%s
22
setlocal iskeyword=@,48-57,-,_,.,/
33
setlocal formatprg=fish_indent
44

5+
" Use the 'man' wrapper function in fish to include fish's man pages.
6+
" Have to use a script for this; 'fish -c man' would make the the man page an
7+
" argument to fish instead of man.
8+
execute 'setlocal keywordprg=fish\ '.expand('<sfile>:p:h:h').'/bin/man.fish'
9+
510
let b:endwise_addition = 'end'
611
let b:endwise_words = 'begin,function,if,switch,while,for'
712
let b:endwise_syngroups = 'fishKeyword,fishConditional,fishRepeat'

0 commit comments

Comments
 (0)