From b40b22f426899d58c32bd7cb788464dc535b1eb9 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 19 Sep 2024 19:46:50 +0200 Subject: vim-patch:f86568f: runtime(misc): simplify keywordprg in various ftplugins closes: vim/vim#15696 https://github.com/vim/vim/commit/f86568f91848ece0c5da2178881b3ed858dae799 Co-authored-by: Konfekt --- runtime/ftplugin/sshconfig.vim | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'runtime/ftplugin/sshconfig.vim') diff --git a/runtime/ftplugin/sshconfig.vim b/runtime/ftplugin/sshconfig.vim index 4a054da52f..1cc4e609b0 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 -" Latest Revision: 2023-10-07 +" Language: OpenSSH client configuration file +" Maintainer: This runtime file is looking for a new maintainer. +" Previous Maintainer: Nikolai Weibull +" 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+' . . '$'' --hilite-search" man ' . 'ssh_config' | - \ redraw! - elseif has('terminal') - command -buffer -nargs=1 SshconfigKeywordPrg - \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . . '$', '\') . ''' --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+' . . '$', '\') . ''' --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 -- cgit