While working with some Vim scripts, I found myself typing
:help {subject}
quite a bit. I want CTRL+] (jump to definition of keyword under cursor) functionality, but instead of running :tag {ident}
I want it to do :help {subject}
, where {subject}
is the word under the cursor.
Searching for help topics :help {subject} (or just :h {subject} ) opens the help tag {subject} . {subject} can include wildcards like * , ? or [a-z] . If there are multiple help tags matching the given subject then when you press Enter Vim opens the “best” match.
Just press K
. If you have set a global 'keywordprg'
, you need to unset it (or set it to the special :help
value) in ~/.vim/after/ftplugin/vim.vim
:
:setlocal keywordprg=:help
The simplest solution is
nnoremap K :help <C-r><C-w><CR>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With