runtime(misc): simplify keywordprg in various ftplugins

Commit: 
https://github.com/vim/vim/commit/f86568f91848ece0c5da2178881b3ed858dae799
Author: Konfekt <konf...@users.noreply.github.com>
Date:   Thu Sep 19 19:34:40 2024 +0200

    runtime(misc): simplify keywordprg in various ftplugins
    
    closes: https://github.com/vim/vim/issues/15696
    
    Signed-off-by: Konfekt <konf...@users.noreply.github.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/ftplugin/gpg.vim b/runtime/ftplugin/gpg.vim
index 7fb4f47ed..bb4e0c9a1 100644
--- a/runtime/ftplugin/gpg.vim
+++ b/runtime/ftplugin/gpg.vim
@@ -1,7 +1,7 @@
 " Vim filetype plugin file
 " Language:             gpg(1) configuration file
 " Previous Maintainer:  Nikolai Weibull <n...@bitwi.se>
-" Latest Revision:      2023-10-07
+" Latest Revision:      2024-09-19 (simplify keywordprg #15696)
 
 if exists("b:did_ftplugin")
   finish
@@ -15,20 +15,12 @@ let b:undo_ftplugin = "setl com< cms< fo<"
 
 setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
 
-if has('unix') && executable('less')
-  if !has('gui_running')
-    command -buffer -nargs=1 GpgKeywordPrg
-          \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+--' . 
<q-args> . ' '' --hilite-search" man ' . 'gpg' |
-          \ redraw!
-  elseif has('terminal')
-    command -buffer -nargs=1 GpgKeywordPrg
-          \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . 
escape('^\s+--' . <q-args> . ' ', '\') . ''' --hilite-search" man ' . 'gpg'
-  endif
-  if exists(':GpgKeywordPrg') == 2
-    setlocal iskeyword+=-
-    setlocal keywordprg=:GpgKeywordPrg
-    let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer GpgKeywordPrg'
-  endif
+if has('unix') && executable('less') && exists(':terminal') == 2
+  command -buffer -nargs=1 GpgKeywordPrg
+        \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . 
escape('^\s+--' . <q-args> . ' ', '\') . ''' --hilite-search" man ' . 'gpg'
+  setlocal iskeyword+=-
+  setlocal keywordprg=:GpgKeywordPrg
+  let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer GpgKeywordPrg'
 endif
 
 let &cpo = s:cpo_save
diff --git a/runtime/ftplugin/modconf.vim b/runtime/ftplugin/modconf.vim
index 22d18a9aa..df1c787e7 100644
--- a/runtime/ftplugin/modconf.vim
+++ b/runtime/ftplugin/modconf.vim
@@ -1,7 +1,7 @@
 " Vim filetype plugin file
 " Language:             modules.conf(5) configuration file
 " Previous Maintainer:  Nikolai Weibull <n...@bitwi.se>
-" Latest Revision:      2023-10-07
+" Latest Revision:      2024-09-19 (simplify keywordprg #15696)
 
 if exists("b:did_ftplugin")
   finish
@@ -16,20 +16,13 @@ let b:undo_ftplugin = "setl com< cms< inc< fo<"
 setlocal comments=:# commentstring=#\ %s include=^\s*include
 setlocal formatoptions-=t formatoptions+=croql
 
-if has('unix') && executable('less')
-  if !has('gui_running')
-    command -buffer -nargs=1 ModconfKeywordPrg
-          \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . 
<q-args> . ' '' --hilite-search" man ' . 'modprobe.d' |
-          \ redraw!
-  elseif has('terminal')
-    command -buffer -nargs=1 ModconfKeywordPrg
-          \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . 
escape('^\s{,8}' . <q-args> . ' ', '\') . ''' --hilite-search" man ' . 
'modprobe.d'
-  endif
-  if exists(':ModconfKeywordPrg') == 2
-    setlocal iskeyword+=-
-    setlocal keywordprg=:ModconfKeywordPrg
-    let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer ModconfKeywordPrg'
-  endif
+if has('unix') && executable('less') && exists(':terminal') == 2
+  command -buffer -nargs=1 ModconfKeywordPrg
+        \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . 
escape('^\s{,8}' . <q-args> . ' ', '\') . ''' --hilite-search" man ' . 
'modprobe.d'
+  setlocal iskeyword+=-
+  setlocal keywordprg=:ModconfKeywordPrg
+  let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer ModconfKeywordPrg'
+endif
 endif
 
 let &cpo = s:cpo_save
diff --git a/runtime/ftplugin/muttrc.vim b/runtime/ftplugin/muttrc.vim
index c9f6df31d..7df61580b 100644
--- a/runtime/ftplugin/muttrc.vim
+++ b/runtime/ftplugin/muttrc.vim
@@ -1,7 +1,7 @@
 " Vim filetype plugin file
 " Language:             mutt RC File
 " Previous Maintainer:  Nikolai Weibull <n...@bitwi.se>
-" Latest Revision:      2023-10-07
+" Latest Revision:      2024-09-19 (simplify keywordprg #15696)
 
 if exists("b:did_ftplugin")
   finish
@@ -18,20 +18,12 @@ setlocal formatoptions-=t formatoptions+=croql
 
 let &l:include = '^\s*source\>'
 
-if has('unix') && executable('less')
-  if !has('gui_running')
-    command -buffer -nargs=1 MuttrcKeywordPrg
-          \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . 
<q-args> . ' '' --hilite-search" man ' . 'muttrc' |
-          \ redraw!
-  elseif has('terminal')
-    command -buffer -nargs=1 MuttrcKeywordPrg
-          \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . 
escape('^\s+' . <q-args> . ' ', '\') . ''' --hilite-search" man ' . 'muttrc'
-  endif
-  if exists(':MuttrcKeywordPrg') == 2
-    setlocal iskeyword+=-
-    setlocal keywordprg=:MuttrcKeywordPrg
-    let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer MuttrcKeywordPrg'
-  endif
+if has('unix') && executable('less') && exists(':terminal') == 2
+  command -buffer -nargs=1 MuttrcKeywordPrg
+        \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . 
escape('^\s+' . <q-args> . ' ', '\') . ''' --hilite-search" man ' . 'muttrc'
+  setlocal iskeyword+=-
+  setlocal keywordprg=:MuttrcKeywordPrg
+  let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer MuttrcKeywordPrg'
 endif
 
 let &cpo = s:cpo_save
diff --git a/runtime/ftplugin/ps1.vim b/runtime/ftplugin/ps1.vim
index 9d698f242..e09bbf86d 100644
--- a/runtime/ftplugin/ps1.vim
+++ b/runtime/ftplugin/ps1.vim
@@ -4,6 +4,7 @@
 " Last Change: 2021 Apr 02
 "              2024 Jan 14 by Vim Project (browsefilter)
 "              2024 May 23 by Riley Bruins <ribr...@gmail.com> 
('commentstring')
+"              2024 Sep 19 by Konfekt (simplify keywordprg #15696)
 
 " Only do this when not done yet for this buffer
 if exists("b:did_ftplugin") | finish | endif
@@ -35,6 +36,10 @@ if (has("gui_win32") || has("gui_gtk")) && 
!exists("b:browsefilter")
        endif
 endif
 
+" Undo the stuff we changed
+let b:undo_ftplugin = "setlocal tw< cms< fo< iskeyword<" .
+                       \ " | unlet! b:browsefilter"
+
 " Look up keywords by Get-Help:
 " check for PowerShell Core in Windows, Linux or MacOS
 if executable('pwsh') | let s:pwsh_cmd = 'pwsh'
@@ -45,21 +50,14 @@ elseif executable('powershell.exe') | let s:pwsh_cmd = 
'powershell.exe'
 endif
 
 if exists('s:pwsh_cmd')
-  if !has('gui_running') && executable('less') &&
-        \ !(exists('$ConEmuBuild') && &term =~? '^xterm')
-    " For exclusion of ConEmu, see 
https://github.com/Maximus5/ConEmu/issues/2048
-    command! -buffer -nargs=1 GetHelp silent exe '!' . s:pwsh_cmd . ' -NoLogo 
-NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help 
-Full "<args>" | ' . (has('unix') ? 'LESS= less' : 'less') | redraw!
-  elseif has('terminal')
+  if exists(':terminal') == 2
     command! -buffer -nargs=1 GetHelp silent exe 'term ' . s:pwsh_cmd . ' 
-NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command 
Get-Help -Full "<args>"' . (executable('less') ? ' | less' : '')
   else
     command! -buffer -nargs=1 GetHelp echo system(s:pwsh_cmd . ' -NoLogo 
-NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help 
-Full <args>')
   endif
+  setlocal keywordprg=:GetHelp
+  let b:undo_ftplugin ..= " | setl kp< | sil! delc -buffer GetHelp"
 endif
-setlocal keywordprg=:GetHelp
-
-" Undo the stuff we changed
-let b:undo_ftplugin = "setlocal tw< cms< fo< iskeyword< keywordprg<" .
-                       \ " | unlet! b:browsefilter"
 
 let &cpo = s:cpo_save
 unlet s:cpo_save
diff --git a/runtime/ftplugin/readline.vim b/runtime/ftplugin/readline.vim
index f5934ce2c..77fab2a61 100644
--- a/runtime/ftplugin/readline.vim
+++ b/runtime/ftplugin/readline.vim
@@ -2,7 +2,7 @@
 " Language:            readline(3) configuration file
 " Maintainer:          Doug Kearns <dougkea...@gmail.com>
 " Previous Maintainer: Nikolai Weibull <n...@bitwi.se>
-" Last Change:         2023 Aug 22
+" Last Change:         2024 Sep 19 (simplify keywordprg #15696)
 
 if exists("b:did_ftplugin")
   finish
@@ -34,20 +34,12 @@ if (has("gui_win32") || has("gui_gtk")) && 
!exists("b:browsefilter")
   let b:undo_ftplugin ..= " | unlet! b:browsefilter"
 endif
 
-if has('unix') && executable('less')
-  if !has('gui_running')
-    command -buffer -nargs=1 ReadlineKeywordPrg
-          \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . 
<q-args> . ' '' --hilite-search" man ' . '3 readline' |
-          \ redraw!
-  elseif has('terminal')
-    command -buffer -nargs=1 ReadlineKeywordPrg
-          \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . 
escape('^\s+' . <q-args> . ' ', '\') . ''' --hilite-search" man ' . '3 readline'
-  endif
-  if exists(':ReadlineKeywordPrg') == 2
-    setlocal iskeyword+=-
-    setlocal keywordprg=:ReadlineKeywordPrg
-    let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer ReadlineKeywordPrg'
-  endif
+if has('unix') && executable('less') && exists(':terminal') == 2
+  command -buffer -nargs=1 ReadlineKeywordPrg
+        \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . 
escape('^\s+' . <q-args> . ' ', '\') . ''' --hilite-search" man ' . '3 readline'
+  setlocal iskeyword+=-
+  setlocal keywordprg=:ReadlineKeywordPrg
+  let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer ReadlineKeywordPrg'
 endif
 
 let &cpo = s:cpo_save
diff --git a/runtime/ftplugin/sh.vim b/runtime/ftplugin/sh.vim
index d2faf1a28..4c7695dcc 100644
--- a/runtime/ftplugin/sh.vim
+++ b/runtime/ftplugin/sh.vim
@@ -45,9 +45,7 @@ if (has("gui_win32") || has("gui_gtk")) && 
!exists("b:browsefilter")
 endif
 
 if get(b:, "is_bash", 0)
-  if !has("gui_running") && executable("less")
-    command! -buffer -nargs=1 ShKeywordPrg silent exe '!bash -c "{ help 
"<args>" 2>/dev/null || MANPAGER= man "<args>"; } | LESS= less"' | redraw!
-  elseif has("terminal")
+  if exists(':terminal') == 2
     command! -buffer -nargs=1 ShKeywordPrg silent exe ':term bash -c "help 
"<args>" 2>/dev/null || man "<args>""'
   else
     command! -buffer -nargs=1 ShKeywordPrg echo system('bash -c "help <args>" 
2>/dev/null || MANPAGER= man "<args>"')
diff --git a/runtime/ftplugin/sshconfig.vim b/runtime/ftplugin/sshconfig.vim
index 4a054da52..1cc4e609b 100644
--- a/runtime/ftplugin/sshconfig.vim
+++ b/runtime/ftplugin/sshconfig.vim
@@ -1,7 +1,8 @@
 " Vim filetype plugin file
-" Language:         OpenSSH client configuration file
-" Previous Maintainer:       Nikolai Weibull <n...@bitwi.se>
-" Latest Revision:  2023-10-07
+" Language:    OpenSSH client configuration file
+" Maintainer:  This runtime file is looking for a new maintainer.
+" Previous Maintainer: Nikolai Weibull <n...@bitwi.se>
+" Latest Revision:     2024-09-19 (simplify keywordprg #15696)
 
 if exists("b:did_ftplugin")
   finish
@@ -14,20 +15,12 @@ set cpo&vim
 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 SshconfigKeywordPrg
-          \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . 
<q-args> . '$'' --hilite-search" man ' . 'ssh_config' |
-          \ redraw!
-  elseif has('terminal')
-    command -buffer -nargs=1 SshconfigKeywordPrg
-          \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . 
escape('^\s+' . <q-args> . '$', '\') . ''' --hilite-search" man ' . 'ssh_config'
-  endif
-  if exists(':SshconfigKeywordPrg') == 2
-    setlocal iskeyword+=-
-    setlocal keywordprg=:SshconfigKeywordPrg
-    let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer SshconfigKeywordPrg'
-  endif
+if has('unix') && executable('less') && exists(':terminal') == 2
+  command -buffer -nargs=1 SshconfigKeywordPrg
+        \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . 
escape('^\s+' . <q-args> . '$', '\') . ''' --hilite-search" man ' . 'ssh_config'
+  setlocal iskeyword+=-
+  setlocal keywordprg=:SshconfigKeywordPrg
+  let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer SshconfigKeywordPrg'
 endif
 
 let &cpo = s:cpo_save
diff --git a/runtime/ftplugin/sudoers.vim b/runtime/ftplugin/sudoers.vim
index 81ce7906a..e87fedaa0 100644
--- a/runtime/ftplugin/sudoers.vim
+++ b/runtime/ftplugin/sudoers.vim
@@ -1,7 +1,8 @@
 " Vim filetype plugin file
-" Language:             sudoers(5) configuration files
-" Previous Maintainer:  Nikolai Weibull <n...@bitwi.se>
-" Latest Revision:      2023-10-07
+" Language:    sudoers(5) configuration files
+" Maintainer:  This runtime file is looking for a new maintainer.
+" Previous Maintainer: Nikolai Weibull <n...@bitwi.se>
+" Latest Revision:     2024-09-19 (simplify keywordprg #15696)
 
 if exists("b:did_ftplugin")
   finish
@@ -15,20 +16,12 @@ let b:undo_ftplugin = "setl com< cms< fo<"
 
 setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
 
-if has('unix') && executable('less')
-  if !has('gui_running')
-    command -buffer -nargs=1 SudoersKeywordPrg
-          \ silent exe '!' . 'LESS= MANPAGER="less --pattern='' ' . <q-args> . 
' '' --hilite-search" man ' . 'sudoers' |
-          \ redraw!
-  elseif has('terminal')
-    command -buffer -nargs=1 SudoersKeywordPrg
-          \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . 
escape(' ' . <q-args> . ' ', '\') . ''' --hilite-search" man ' . 'sudoers'
-  endif
-  if exists(':SudoersKeywordPrg') == 2
-    setlocal iskeyword+=-
-    setlocal keywordprg=:SudoersKeywordPrg
-    let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer SudoersKeywordPrg'
-  endif
+if has('unix') && executable('less') && exists(':terminal') == 2
+  command -buffer -nargs=1 SudoersKeywordPrg
+        \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . 
escape(' ' . <q-args> . ' ', '\') . ''' --hilite-search" man ' . 'sudoers'
+  setlocal iskeyword+=-
+  setlocal keywordprg=:SudoersKeywordPrg
+  let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer SudoersKeywordPrg'
 endif
 
 let &cpo = s:cpo_save
diff --git a/runtime/ftplugin/systemd.vim b/runtime/ftplugin/systemd.vim
index d268bfee7..44e70bc22 100644
--- a/runtime/ftplugin/systemd.vim
+++ b/runtime/ftplugin/systemd.vim
@@ -1,7 +1,7 @@
 " Vim filetype plugin file
 " Language:                    systemd.unit(5)
 " Keyword Lookup Support:      Enno Nagel <enno.nagel+...@gmail.com>
-" Latest Revision:      2023-10-07
+" Latest Revision:             2024-09-19 (simplify keywordprg #15696)
 
 if exists("b:did_ftplugin")
   finish
@@ -9,30 +9,22 @@ endif
 " Looks a lot like dosini files.
 runtime! ftplugin/dosini.vim
 
-if has('unix') && executable('less')
-  if !has('gui_running')
-    command -buffer -nargs=1 SystemdKeywordPrg silent exe '!' . 
KeywordLookup_systemd(<q-args>) | redraw!
-  elseif has('terminal')
-    command -buffer -nargs=1 SystemdKeywordPrg silent exe 'term ' . 
KeywordLookup_systemd(<q-args>)
-  endif
-  if exists(':SystemdKeywordPrg') == 2
-    if !exists('*KeywordLookup_systemd')
-      function KeywordLookup_systemd(keyword) abort
-        let matches = matchlist(getline(search(' ^\s*\[\s*.+\s*\]\s*$', 
'nbWz')), ' ^\s*\[\s*(\k+).*\]\s*$')
-        if len(matches) > 1
-          let section = matches[1]
-          return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . 
'=$'' --hilite-search" man ' . 'systemd.' . section
-        else
-          return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . 
'=$'' --hilite-search" man ' . 'systemd'
-        endif
-      endfunction
-    endif
-    setlocal iskeyword+=-
-    setlocal keywordprg=:SystemdKeywordPrg
-    if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin)
-      let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<'
+if has('unix') && executable('less') && exists(':terminal') == 2
+  command -buffer -nargs=1 SystemdKeywordPrg silent exe 'term ' . 
KeywordLookup_systemd(<q-args>)
+  silent! function KeywordLookup_systemd(keyword) abort
+    let matches = matchlist(getline(search(' ^\s*\[\s*.+\s*\]\s*$', 'nbWz')), 
' ^\s*\[\s*(\k+).*\]\s*$')
+    if len(matches) > 1
+      let section = matches[1]
+      return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' 
--hilite-search" man ' . 'systemd.' . section
     else
-      let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer SystemdKeywordPrg'
+      return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' 
--hilite-search" man ' . 'systemd'
     endif
+  endfunction
+  setlocal iskeyword+=-
+  setlocal keywordprg=:SystemdKeywordPrg
+  if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin)
+    let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<'
+  else
+    let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer SystemdKeywordPrg'
   endif
 endif
diff --git a/runtime/ftplugin/udevrules.vim b/runtime/ftplugin/udevrules.vim
index ec365f04c..e6c7f113c 100644
--- a/runtime/ftplugin/udevrules.vim
+++ b/runtime/ftplugin/udevrules.vim
@@ -1,7 +1,8 @@
 " Vim filetype plugin file
-" Language:             udev(8) rules file
-" Previous Maintainer:  Nikolai Weibull <n...@bitwi.se>
-" Latest Revision:      2023-10-07
+" Language:    udev(8) rules file
+" Maintainer:  This runtime file is looking for a new maintainer.
+" Previous Maintainer: Nikolai Weibull <n...@bitwi.se>
+" Latest Revision:     2024-09-19 (simplify keywordprg #15696)
 
 if exists("b:did_ftplugin")
   finish
@@ -15,20 +16,12 @@ let b:undo_ftplugin = "setl com< cms< fo<"
 
 setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
 
-if has('unix') && executable('less')
-  if !has('gui_running')
-    command -buffer -nargs=1 UdevrulesKeywordPrg
-          \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . 
<q-args> . ' '' --hilite-search" man ' . 'udev' |
-          \ redraw!
-  elseif has('terminal')
-    command -buffer -nargs=1 UdevrulesKeywordPrg
-          \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . 
escape('^\s{,8}' . <q-args> . ' ', '\') . ''' --hilite-search" man ' . 'udev'
-  endif
-  if exists(':UdevrulesKeywordPrg') == 2
-    setlocal iskeyword+=-
-    setlocal keywordprg=:UdevrulesKeywordPrg
-    let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer UdevrulesKeywordPrg'
-  endif
+if has('unix') && executable('less') && exists(':terminal') == 2
+  command -buffer -nargs=1 UdevrulesKeywordPrg
+        \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . 
escape('^\s{,8}' . <q-args> . ' ', '\') . ''' --hilite-search" man ' . 'udev'
+  setlocal iskeyword+=-
+  setlocal keywordprg=:UdevrulesKeywordPrg
+  let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc 
-buffer UdevrulesKeywordPrg'
 endif
 
 let &cpo = s:cpo_save
diff --git a/runtime/ftplugin/zsh.vim b/runtime/ftplugin/zsh.vim
index 5e69336aa..5d4f4fe25 100644
--- a/runtime/ftplugin/zsh.vim
+++ b/runtime/ftplugin/zsh.vim
@@ -19,9 +19,7 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t 
formatoptions+=croql
 let b:undo_ftplugin = "setl com< cms< fo< "
 
 if executable('zsh') && &shell !~# '/\%(nologin\|false\)$'
-  if !has('gui_running') && executable('less')
-    command! -buffer -nargs=1 ZshKeywordPrg silent exe '!MANPAGER= zsh -c 
"autoload -Uz run-help; run-help <args> 2>/dev/null | LESS= less"' | redraw!
-  elseif has('terminal')
+  if exists(':terminal') == 2
     command! -buffer -nargs=1 ZshKeywordPrg silent exe ':term zsh -c "autoload 
-Uz run-help; run-help <args>"'
   else
     command! -buffer -nargs=1 ZshKeywordPrg echo system('MANPAGER= zsh -c 
"autoload -Uz run-help; run-help <args> 2>/dev/null"')

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1srLDD-00A0oO-BY%40256bit.org.

Raspunde prin e-mail lui