runtime: configure keywordpg for some file types (#5566)

Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/ftplugin/sshconfig.vim b/runtime/ftplugin/sshconfig.vim
index d933ce0..214e492 100644
--- a/runtime/ftplugin/sshconfig.vim
+++ b/runtime/ftplugin/sshconfig.vim
@@ -1,7 +1,7 @@
 " Vim filetype plugin file
-" Language:             OpenSSH client configuration file
-" Previous Maintainer:  Nikolai Weibull <now@bitwi.se>
-" Latest Revision:      2008-07-09
+" Language:         OpenSSH client configuration file
+" Previous Maintainer:       Nikolai Weibull <now@bitwi.se>
+" Latest Revision:  2008-07-09
 
 if exists("b:did_ftplugin")
   finish
@@ -11,9 +11,24 @@
 let s:cpo_save = &cpo
 set cpo&vim
 
-let b:undo_ftplugin = "setl com< cms< fo<"
-
 setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
+let b:undo_ftplugin = 'setlocal com< cms< fo<'
+
+if has('unix') && executable('less')
+  if !has('gui_running')
+    command -buffer -nargs=1 Sman
+          \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '$'' --hilite-search" man ' . 'ssh_config' |
+          \ redraw!
+  elseif has('terminal')
+    command -buffer -nargs=1 Sman
+          \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '$', '\') . ''' --hilite-search" man ' . 'ssh_config'
+  endif
+  if exists(':Sman') == 2
+    setlocal iskeyword+=-
+    setlocal keywordprg=:Sman
+    let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<'
+  endif
+endif
 
 let &cpo = s:cpo_save
 unlet s:cpo_save