From e2c10dea19a329f7913eb1d6110f10ec4bc525f9 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 24 Aug 2023 09:08:24 +0900 Subject: vim-patch:2f25e40b1f54 runtime: configure keywordpg for some file types (vim/vim#5566) https://github.com/vim/vim/commit/2f25e40b1f545f4aa38377f0c25effb112b5d1ef Co-authored-by: Enno --- runtime/ftplugin/sudoers.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'runtime/ftplugin/sudoers.vim') diff --git a/runtime/ftplugin/sudoers.vim b/runtime/ftplugin/sudoers.vim index 38dbf559ee..65cf2d8203 100644 --- a/runtime/ftplugin/sudoers.vim +++ b/runtime/ftplugin/sudoers.vim @@ -15,5 +15,21 @@ 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 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''\b' . . '\b'' --hilite-search" man ' . 'sudoers' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('\b' . . '\b', '\') . ''' --hilite-search" man ' . 'sudoers' + 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 -- cgit From b2c3e9c72ef12a5bc276dec78cdc8dfbd2f5a24b Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 30 Aug 2023 18:16:30 +0200 Subject: vim-patch:9d8ef7cc4340 runtime: cleanup :Sman command via the undo_ftplugin mechanism (vim/vim#12967) Regards to @dkearns as noticed in https://github.com/vim/vim/commit/2ac708b548660b232a32c52d89bde3d8596646c0 https://github.com/vim/vim/commit/9d8ef7cc434076dfda62ca3d3101eaae52e316cd Co-authored-by: Enno --- runtime/ftplugin/sudoers.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/ftplugin/sudoers.vim') diff --git a/runtime/ftplugin/sudoers.vim b/runtime/ftplugin/sudoers.vim index 65cf2d8203..b4123620af 100644 --- a/runtime/ftplugin/sudoers.vim +++ b/runtime/ftplugin/sudoers.vim @@ -27,7 +27,7 @@ if has('unix') && executable('less') if exists(':Sman') == 2 setlocal iskeyword+=- setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' endif endif -- cgit From e5855697e90e379128a018a8d88cf5ec008b0623 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 8 Oct 2023 19:17:19 +0200 Subject: 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. https://github.com/vim/vim/commit/1e33cd72b60a119a038952bb658862d038602f76 Co-authored-by: Enno --- runtime/ftplugin/sudoers.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'runtime/ftplugin/sudoers.vim') diff --git a/runtime/ftplugin/sudoers.vim b/runtime/ftplugin/sudoers.vim index b4123620af..81ce7906a9 100644 --- a/runtime/ftplugin/sudoers.vim +++ b/runtime/ftplugin/sudoers.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: sudoers(5) configuration files " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2008-07-09 +" Latest Revision: 2023-10-07 if exists("b:did_ftplugin") finish @@ -17,17 +17,17 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql if has('unix') && executable('less') if !has('gui_running') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 SudoersKeywordPrg \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''\b' . . '\b'' --hilite-search" man ' . 'sudoers' | \ redraw! elseif has('terminal') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 SudoersKeywordPrg \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('\b' . . '\b', '\') . ''' --hilite-search" man ' . 'sudoers' endif - if exists(':Sman') == 2 + if exists(':SudoersKeywordPrg') == 2 setlocal iskeyword+=- - setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' + setlocal keywordprg=:SudoersKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SudoersKeywordPrg' endif endif -- cgit