annotate runtime/ftplugin/systemd.vim @ 33649:88cad94caef9

runtime(doc): Fix typos in several documents (#13420) Commit: https://github.com/vim/vim/commit/5985879e3c36383155f84649fa42d06813a1893e Author: h_east <h.east.727@gmail.com> Date: Wed Oct 25 22:47:05 2023 +0900 runtime(doc): Fix typos in several documents (https://github.com/vim/vim/issues/13420) * Fix typos in several documents * Update runtime/doc/terminal.txt Co-authored-by: K.Takata <kentkt@csc.jp> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 25 Oct 2023 16:00:07 +0200
parents b59496c2797b
children 89b487b08b2a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7176
30042ddff503 commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 " Vim filetype plugin file
20115
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 7176
diff changeset
2 " Language: systemd.unit(5)
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 7176
diff changeset
3 " Keyword Lookup Support: Enno Nagel <enno.nagel+vim@gmail.com>
33508
c252fbfde41d runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents: 33074
diff changeset
4 " Latest Revision: 2023-10-07
7176
30042ddff503 commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5
33600
b59496c2797b runtime(systemd): allow for overriding systemd ftplugin settings (#13373)
Christian Brabandt <cb@256bit.org>
parents: 33508
diff changeset
6 if exists("b:did_ftplugin")
b59496c2797b runtime(systemd): allow for overriding systemd ftplugin settings (#13373)
Christian Brabandt <cb@256bit.org>
parents: 33508
diff changeset
7 finish
7176
30042ddff503 commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
8 endif
33600
b59496c2797b runtime(systemd): allow for overriding systemd ftplugin settings (#13373)
Christian Brabandt <cb@256bit.org>
parents: 33508
diff changeset
9 " Looks a lot like dosini files.
b59496c2797b runtime(systemd): allow for overriding systemd ftplugin settings (#13373)
Christian Brabandt <cb@256bit.org>
parents: 33508
diff changeset
10 runtime! ftplugin/dosini.vim
20115
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 7176
diff changeset
11
32976
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
12 if has('unix') && executable('less')
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
13 if !has('gui_running')
33508
c252fbfde41d runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents: 33074
diff changeset
14 command -buffer -nargs=1 SystemdKeywordPrg silent exe '!' . KeywordLookup_systemd(<q-args>) | redraw!
32976
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
15 elseif has('terminal')
33508
c252fbfde41d runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents: 33074
diff changeset
16 command -buffer -nargs=1 SystemdKeywordPrg silent exe 'term ' . KeywordLookup_systemd(<q-args>)
32976
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
17 endif
33508
c252fbfde41d runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents: 33074
diff changeset
18 if exists(':SystemdKeywordPrg') == 2
32976
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
19 if !exists('*KeywordLookup_systemd')
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
20 function KeywordLookup_systemd(keyword) abort
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
21 let matches = matchlist(getline(search('\v^\s*\[\s*.+\s*\]\s*$', 'nbWz')), '\v^\s*\[\s*(\k+).*\]\s*$')
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
22 if len(matches) > 1
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
23 let section = matches[1]
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
24 return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd.' . section
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
25 else
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
26 return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd'
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
27 endif
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
28 endfunction
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
29 endif
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
30 setlocal iskeyword+=-
33508
c252fbfde41d runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents: 33074
diff changeset
31 setlocal keywordprg=:SystemdKeywordPrg
32976
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
32 if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin)
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
33 let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<'
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
34 else
33508
c252fbfde41d runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents: 33074
diff changeset
35 let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SystemdKeywordPrg'
32976
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
36 endif
d23645a0aca8 runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents: 20115
diff changeset
37 endif
20115
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 7176
diff changeset
38 endif