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/sshconfig.vim | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'runtime/ftplugin/sshconfig.vim') diff --git a/runtime/ftplugin/sshconfig.vim b/runtime/ftplugin/sshconfig.vim index d933ce0527..214e4928a0 100644 --- a/runtime/ftplugin/sshconfig.vim +++ b/runtime/ftplugin/sshconfig.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file -" Language: OpenSSH client configuration file -" Previous Maintainer: Nikolai Weibull -" Latest Revision: 2008-07-09 +" Language: OpenSSH client configuration file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish @@ -11,9 +11,24 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim -let b:undo_ftplugin = "setl com< cms< fo<" - 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 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . . '$'' --hilite-search" man ' . 'ssh_config' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . . '$', '\') . ''' --hilite-search" man ' . 'ssh_config' + 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