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/modconf.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'runtime/ftplugin/modconf.vim') diff --git a/runtime/ftplugin/modconf.vim b/runtime/ftplugin/modconf.vim index c8e76b538b..09ad54b64a 100644 --- a/runtime/ftplugin/modconf.vim +++ b/runtime/ftplugin/modconf.vim @@ -16,5 +16,21 @@ 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 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . . '\b'' --hilite-search" man ' . 'modprobe.d' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . . '\b', '\') . ''' --hilite-search" man ' . 'modprobe.d' + 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/modconf.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/ftplugin/modconf.vim') diff --git a/runtime/ftplugin/modconf.vim b/runtime/ftplugin/modconf.vim index 09ad54b64a..d5eda5af21 100644 --- a/runtime/ftplugin/modconf.vim +++ b/runtime/ftplugin/modconf.vim @@ -28,7 +28,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/modconf.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'runtime/ftplugin/modconf.vim') diff --git a/runtime/ftplugin/modconf.vim b/runtime/ftplugin/modconf.vim index d5eda5af21..22d18a9aad 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 -" Latest Revision: 2008-07-09 +" Latest Revision: 2023-10-07 if exists("b:did_ftplugin") finish @@ -18,17 +18,17 @@ setlocal formatoptions-=t formatoptions+=croql if has('unix') && executable('less') if !has('gui_running') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 ModconfKeywordPrg \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . . '\b'' --hilite-search" man ' . 'modprobe.d' | \ redraw! elseif has('terminal') - command -buffer -nargs=1 Sman + command -buffer -nargs=1 ModconfKeywordPrg \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . . '\b', '\') . ''' --hilite-search" man ' . 'modprobe.d' endif - if exists(':Sman') == 2 + if exists(':ModconfKeywordPrg') == 2 setlocal iskeyword+=- - setlocal keywordprg=:Sman - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer Sman' + setlocal keywordprg=:ModconfKeywordPrg + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ModconfKeywordPrg' endif endif -- cgit