vim-patch:1e33cd72b60a

runtime: make command name for &iskeywordprg more unique (vim/vim#13297)

See https://github.com/vim/vim/pull/13213/commits by @dkearns:
Rename 'keywordprg' user command to ShKeywordPrg as this is just a
leaking implementation detail.

1e33cd72b6

Co-authored-by: Enno <Konfekt@users.noreply.github.com>
This commit is contained in:
Christian Clason 2023-10-08 19:17:19 +02:00
parent 30d311ebcf
commit e5855697e9
9 changed files with 53 additions and 52 deletions

View File

@ -1,7 +1,7 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: gpg(1) configuration file " Language: gpg(1) configuration file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09 " Latest Revision: 2023-10-07
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@ -17,17 +17,17 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
if has('unix') && executable('less') if has('unix') && executable('less')
if !has('gui_running') if !has('gui_running')
command -buffer -nargs=1 Sman command -buffer -nargs=1 GpgKeywordPrg
\ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+--' . <q-args> . '\b'' --hilite-search" man ' . 'gpg' | \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+--' . <q-args> . '\b'' --hilite-search" man ' . 'gpg' |
\ redraw! \ redraw!
elseif has('terminal') elseif has('terminal')
command -buffer -nargs=1 Sman command -buffer -nargs=1 GpgKeywordPrg
\ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+--' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'gpg' \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+--' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'gpg'
endif endif
if exists(':Sman') == 2 if exists(':GpgKeywordPrg') == 2
setlocal iskeyword+=- setlocal iskeyword+=-
setlocal keywordprg=:Sman setlocal keywordprg=:GpgKeywordPrg
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer GpgKeywordPrg'
endif endif
endif endif

View File

@ -1,7 +1,7 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: modules.conf(5) configuration file " Language: modules.conf(5) configuration file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09 " Latest Revision: 2023-10-07
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@ -18,17 +18,17 @@ setlocal formatoptions-=t formatoptions+=croql
if has('unix') && executable('less') if has('unix') && executable('less')
if !has('gui_running') if !has('gui_running')
command -buffer -nargs=1 Sman command -buffer -nargs=1 ModconfKeywordPrg
\ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . <q-args> . '\b'' --hilite-search" man ' . 'modprobe.d' | \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . <q-args> . '\b'' --hilite-search" man ' . 'modprobe.d' |
\ redraw! \ redraw!
elseif has('terminal') elseif has('terminal')
command -buffer -nargs=1 Sman command -buffer -nargs=1 ModconfKeywordPrg
\ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'modprobe.d' \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'modprobe.d'
endif endif
if exists(':Sman') == 2 if exists(':ModconfKeywordPrg') == 2
setlocal iskeyword+=- setlocal iskeyword+=-
setlocal keywordprg=:Sman setlocal keywordprg=:ModconfKeywordPrg
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ModconfKeywordPrg'
endif endif
endif endif

View File

@ -1,7 +1,7 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: mutt RC File " Language: mutt RC File
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19 " Latest Revision: 2023-10-07
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@ -20,17 +20,17 @@ let &l:include = '^\s*source\>'
if has('unix') && executable('less') if has('unix') && executable('less')
if !has('gui_running') if !has('gui_running')
command -buffer -nargs=1 Sman command -buffer -nargs=1 MuttrcKeywordPrg
\ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . 'muttrc' | \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . 'muttrc' |
\ redraw! \ redraw!
elseif has('terminal') elseif has('terminal')
command -buffer -nargs=1 Sman command -buffer -nargs=1 MuttrcKeywordPrg
\ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'muttrc' \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'muttrc'
endif endif
if exists(':Sman') == 2 if exists(':MuttrcKeywordPrg') == 2
setlocal iskeyword+=- setlocal iskeyword+=-
setlocal keywordprg=:Sman setlocal keywordprg=:MuttrcKeywordPrg
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer MuttrcKeywordPrg'
endif endif
endif endif

View File

@ -32,17 +32,17 @@ endif
if has('unix') && executable('less') if has('unix') && executable('less')
if !has('gui_running') if !has('gui_running')
command -buffer -nargs=1 Sman command -buffer -nargs=1 ReadlineKeywordPrg
\ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . '3 readline' | \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . '3 readline' |
\ redraw! \ redraw!
elseif has('terminal') elseif has('terminal')
command -buffer -nargs=1 Sman command -buffer -nargs=1 ReadlineKeywordPrg
\ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . '3 readline' \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . '3 readline'
endif endif
if exists(':Sman') == 2 if exists(':ReadlineKeywordPrg') == 2
setlocal iskeyword+=- setlocal iskeyword+=-
setlocal keywordprg=:Sman setlocal keywordprg=:ReadlineKeywordPrg
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ReadlineKeywordPrg'
endif endif
endif endif

View File

@ -1,7 +1,7 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: OpenSSH client configuration file " Language: OpenSSH client configuration file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09 " Latest Revision: 2023-10-07
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@ -16,17 +16,17 @@ let b:undo_ftplugin = 'setlocal com< cms< fo<'
if has('unix') && executable('less') if has('unix') && executable('less')
if !has('gui_running') if !has('gui_running')
command -buffer -nargs=1 Sman command -buffer -nargs=1 SshconfigKeywordPrg
\ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '$'' --hilite-search" man ' . 'ssh_config' | \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '$'' --hilite-search" man ' . 'ssh_config' |
\ redraw! \ redraw!
elseif has('terminal') elseif has('terminal')
command -buffer -nargs=1 Sman command -buffer -nargs=1 SshconfigKeywordPrg
\ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '$', '\') . ''' --hilite-search" man ' . 'ssh_config' \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '$', '\') . ''' --hilite-search" man ' . 'ssh_config'
endif endif
if exists(':Sman') == 2 if exists(':SshconfigKeywordPrg') == 2
setlocal iskeyword+=- setlocal iskeyword+=-
setlocal keywordprg=:Sman setlocal keywordprg=:SshconfigKeywordPrg
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SshconfigKeywordPrg'
endif endif
endif endif

View File

@ -1,7 +1,7 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: sudoers(5) configuration files " Language: sudoers(5) configuration files
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09 " Latest Revision: 2023-10-07
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@ -17,17 +17,17 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
if has('unix') && executable('less') if has('unix') && executable('less')
if !has('gui_running') if !has('gui_running')
command -buffer -nargs=1 Sman command -buffer -nargs=1 SudoersKeywordPrg
\ silent exe '!' . 'LESS= MANPAGER="less --pattern=''\b' . <q-args> . '\b'' --hilite-search" man ' . 'sudoers' | \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''\b' . <q-args> . '\b'' --hilite-search" man ' . 'sudoers' |
\ redraw! \ redraw!
elseif has('terminal') elseif has('terminal')
command -buffer -nargs=1 Sman command -buffer -nargs=1 SudoersKeywordPrg
\ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('\b' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'sudoers' \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('\b' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'sudoers'
endif endif
if exists(':Sman') == 2 if exists(':SudoersKeywordPrg') == 2
setlocal iskeyword+=- setlocal iskeyword+=-
setlocal keywordprg=:Sman setlocal keywordprg=:SudoersKeywordPrg
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SudoersKeywordPrg'
endif endif
endif endif

View File

@ -1,6 +1,7 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: systemd.unit(5) " Language: systemd.unit(5)
" Keyword Lookup Support: Enno Nagel <enno.nagel+vim@gmail.com> " Keyword Lookup Support: Enno Nagel <enno.nagel+vim@gmail.com>
" Latest Revision: 2023-10-07
if !exists('b:did_ftplugin') if !exists('b:did_ftplugin')
" Looks a lot like dosini files. " Looks a lot like dosini files.
@ -9,11 +10,11 @@ endif
if has('unix') && executable('less') if has('unix') && executable('less')
if !has('gui_running') if !has('gui_running')
command -buffer -nargs=1 Sman silent exe '!' . KeywordLookup_systemd(<q-args>) | redraw! command -buffer -nargs=1 SystemdKeywordPrg silent exe '!' . KeywordLookup_systemd(<q-args>) | redraw!
elseif has('terminal') elseif has('terminal')
command -buffer -nargs=1 Sman silent exe 'term ' . KeywordLookup_systemd(<q-args>) command -buffer -nargs=1 SystemdKeywordPrg silent exe 'term ' . KeywordLookup_systemd(<q-args>)
endif endif
if exists(':Sman') == 2 if exists(':SystemdKeywordPrg') == 2
if !exists('*KeywordLookup_systemd') if !exists('*KeywordLookup_systemd')
function KeywordLookup_systemd(keyword) abort function KeywordLookup_systemd(keyword) abort
let matches = matchlist(getline(search('\v^\s*\[\s*.+\s*\]\s*$', 'nbWz')), '\v^\s*\[\s*(\k+).*\]\s*$') let matches = matchlist(getline(search('\v^\s*\[\s*.+\s*\]\s*$', 'nbWz')), '\v^\s*\[\s*(\k+).*\]\s*$')
@ -26,11 +27,11 @@ if has('unix') && executable('less')
endfunction endfunction
endif endif
setlocal iskeyword+=- setlocal iskeyword+=-
setlocal keywordprg=:Sman setlocal keywordprg=:SystemdKeywordPrg
if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin) if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin)
let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<' let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<'
else else
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SystemdKeywordPrg'
endif endif
endif endif
endif endif

View File

@ -1,7 +1,7 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: udev(8) rules file " Language: udev(8) rules file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09 " Latest Revision: 2023-10-07
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@ -17,17 +17,17 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
if has('unix') && executable('less') if has('unix') && executable('less')
if !has('gui_running') if !has('gui_running')
command -buffer -nargs=1 Sman command -buffer -nargs=1 UdevrulesKeywordPrg
\ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . <q-args> . '\b'' --hilite-search" man ' . 'udev' | \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . <q-args> . '\b'' --hilite-search" man ' . 'udev' |
\ redraw! \ redraw!
elseif has('terminal') elseif has('terminal')
command -buffer -nargs=1 Sman command -buffer -nargs=1 UdevrulesKeywordPrg
\ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'udev' \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'udev'
endif endif
if exists(':Sman') == 2 if exists(':UdevrulesKeywordPrg') == 2
setlocal iskeyword+=- setlocal iskeyword+=-
setlocal keywordprg=:Sman setlocal keywordprg=:UdevrulesKeywordPrg
let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer UdevrulesKeywordPrg'
endif endif
endif endif

View File

@ -2,7 +2,7 @@
" Language: Zsh shell script " Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org> " Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2021-04-03 " Latest Revision: 2023-10-07
" License: Vim (see :h license) " License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh " Repository: https://github.com/chrisbra/vim-zsh
@ -20,17 +20,17 @@ let b:undo_ftplugin = "setl com< cms< fo< "
if executable('zsh') && &shell !~# '/\%(nologin\|false\)$' if executable('zsh') && &shell !~# '/\%(nologin\|false\)$'
if !has('gui_running') && executable('less') if !has('gui_running') && executable('less')
command! -buffer -nargs=1 RunHelp silent exe '!MANPAGER= zsh -c "autoload -Uz run-help; run-help <args> 2>/dev/null | LESS= less"' | redraw! 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') elseif has('terminal')
command! -buffer -nargs=1 RunHelp silent exe ':term zsh -c "autoload -Uz run-help; run-help <args>"' command! -buffer -nargs=1 ZshKeywordPrg silent exe ':term zsh -c "autoload -Uz run-help; run-help <args>"'
else else
command! -buffer -nargs=1 RunHelp echo system('zsh -c "autoload -Uz run-help; run-help <args> 2>/dev/null"') command! -buffer -nargs=1 ZshKeywordPrg echo system('zsh -c "autoload -Uz run-help; run-help <args> 2>/dev/null"')
endif endif
if !exists('current_compiler') if !exists('current_compiler')
compiler zsh compiler zsh
endif endif
setlocal keywordprg=:RunHelp setlocal keywordprg=:ZshKeywordPrg
let b:undo_ftplugin .= 'keywordprg< | sil! delc -buffer RunHelp' let b:undo_ftplugin .= 'keywordprg< | sil! delc -buffer ZshKeywordPrg'
endif endif
let b:match_words = '\<if\>:\<elif\>:\<else\>:\<fi\>' let b:match_words = '\<if\>:\<elif\>:\<else\>:\<fi\>'