aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin/help.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-08-07 14:23:06 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-08-07 14:29:41 +1200
commit981021f18aa9ada153070b08b4fc075059999190 (patch)
tree51feef2c4046bb550d1fb0ae07ed4fbf22be5ba6 /vim/after/ftplugin/help.vim
parentRevert "Use ^= instead of += for arbitrary tex..." (diff)
downloaddotfiles-981021f18aa9ada153070b08b4fc075059999190.tar.gz
dotfiles-981021f18aa9ada153070b08b4fc075059999190.zip
Bind K in Vim help to jump to tag
Diffstat (limited to 'vim/after/ftplugin/help.vim')
-rw-r--r--vim/after/ftplugin/help.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/vim/after/ftplugin/help.vim b/vim/after/ftplugin/help.vim
index e21a5259..db621315 100644
--- a/vim/after/ftplugin/help.vim
+++ b/vim/after/ftplugin/help.vim
@@ -9,3 +9,14 @@ if has('conceal') && &modifiable && !&readonly
setlocal conceallevel=0
let b:undo_ftplugin .= '|setlocal conceallevel<'
endif
+
+" Stop here if the user doesn't want ftplugin mappings
+if exists('g:no_plugin_maps') || exists('g:no_help_maps')
+ finish
+endif
+
+" Make K jump to the help topic; NeoVim does this, and it's a damned good idea
+if !has('nvim')
+ nnoremap <buffer> K <C-]>
+ let b:undo_ftplugin .= '|nunmap <buffer> K'
+endif