annotate runtime/ftplugin/systemd.vim @ 35285:d10d4f662b4b default tip

runtime(doc): Add ft_hare.txt to Reference Manual TOC Commit: https://github.com/vim/vim/commit/0bdc5d8241335c3451f629eed7a3734021d41679 Author: h-east <h.east.727@gmail.com> Date: Mon May 27 17:12:57 2024 +0200 runtime(doc): Add ft_hare.txt to Reference Manual TOC while at it, also re-align ft_context.txt with the rest of the list. closes: #14863 Signed-off-by: h-east <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Mon, 27 May 2024 17:30:03 +0200
parents b59496c2797b
children
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