aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-01-06 15:24:31 +1300
committerTom Ryder <tom@sanctum.geek.nz>2019-01-06 15:24:31 +1300
commit3e3e0488eb70c91195707027db0e83d4c358fa6c (patch)
treebad1aee6b532e4d07b15649e37ebfa20026821b7 /vim/after/ftplugin
parent533c224c7522950385b0ff833c37ca404b14e2ea (diff)
downloaddotfiles-3e3e0488eb70c91195707027db0e83d4c358fa6c.tar.gz
dotfiles-3e3e0488eb70c91195707027db0e83d4c358fa6c.zip
Add test to 'keywordprg' setting for Vim help
Diffstat (limited to 'vim/after/ftplugin')
-rw-r--r--vim/after/ftplugin/help.vim9
1 files changed, 6 insertions, 3 deletions
diff --git a/vim/after/ftplugin/help.vim b/vim/after/ftplugin/help.vim
index a0b637aa..a72dac8e 100644
--- a/vim/after/ftplugin/help.vim
+++ b/vim/after/ftplugin/help.vim
@@ -11,9 +11,12 @@ if has('conceal') && &modifiable && !&readonly
let b:undo_ftplugin .= '|setlocal conceallevel<'
endif
-" Use :help for 'keywordprg'; odd that this isn't the default
-setlocal keywordprg=:help
-let b:undo_ftplugin .= '|setlocal keywordprg<'
+" Use :help as 'keywordprg' if not already set; this is the default since Vim
+" v8.1.0690
+if &keywordprg !=# ':help'
+ setlocal keywordprg=:help
+ let b:undo_ftplugin .= '|setlocal keywordprg<'
+endif
" Stop here if the user doesn't want ftplugin mappings
if exists('g:no_plugin_maps') || exists('g:no_help_maps')