Example. How to make perl's keyword program to look into both functions and module helps.
Old one, looking only for function's help:
au BufReadPost *.pl  set keywordprg=perldoc\ -f
The trick in action:
au BufReadPost *.pl  set keywordprg=f(){\ perldoc\ -f\ $*\|\|perldoc\ $*;};f
Deescaped command looks like that:
f(){ perldoc -f $* || perldoc $*; }; f
VIM would append the word to search for at the end and run it. Shell would see pretty normal function definition and immediately after a call to it.
The trick obviously works only on the platforms which have Bourne shell.
No comments:
Post a Comment