blob: 4a054da52f334450ddc141788433337bf2636928 [file] [log] [blame]
Bram Moolenaar42eeac32005-06-29 22:40:58 +00001" Vim filetype plugin file
Enno2f25e402023-08-23 21:27:50 +02002" Language: OpenSSH client configuration file
3" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
Enno1e33cd72023-10-08 19:14:07 +02004" Latest Revision: 2023-10-07
Bram Moolenaar42eeac32005-06-29 22:40:58 +00005
6if exists("b:did_ftplugin")
7 finish
8endif
9let b:did_ftplugin = 1
10
Bram Moolenaare37d50a2008-08-06 17:06:04 +000011let s:cpo_save = &cpo
12set cpo&vim
13
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000014setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
Enno2f25e402023-08-23 21:27:50 +020015let b:undo_ftplugin = 'setlocal com< cms< fo<'
16
17if has('unix') && executable('less')
18 if !has('gui_running')
Enno1e33cd72023-10-08 19:14:07 +020019 command -buffer -nargs=1 SshconfigKeywordPrg
Enno2f25e402023-08-23 21:27:50 +020020 \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '$'' --hilite-search" man ' . 'ssh_config' |
21 \ redraw!
22 elseif has('terminal')
Enno1e33cd72023-10-08 19:14:07 +020023 command -buffer -nargs=1 SshconfigKeywordPrg
Enno2f25e402023-08-23 21:27:50 +020024 \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '$', '\') . ''' --hilite-search" man ' . 'ssh_config'
25 endif
Enno1e33cd72023-10-08 19:14:07 +020026 if exists(':SshconfigKeywordPrg') == 2
Enno2f25e402023-08-23 21:27:50 +020027 setlocal iskeyword+=-
Enno1e33cd72023-10-08 19:14:07 +020028 setlocal keywordprg=:SshconfigKeywordPrg
29 let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SshconfigKeywordPrg'
Enno2f25e402023-08-23 21:27:50 +020030 endif
31endif
Bram Moolenaare37d50a2008-08-06 17:06:04 +000032
33let &cpo = s:cpo_save
34unlet s:cpo_save