Mercurial > vim
annotate runtime/ftplugin/systemd.vim @ 31938:96d6d31dd66b v9.0.1301
patch 9.0.1301: virtual text below empty line not displayed
Commit: https://github.com/vim/vim/commit/9d9a20ee8799bafe9caac616fef11b7a26db6a8d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 11 13:49:01 2023 +0000
patch 9.0.1301: virtual text below empty line not displayed
Problem: Virtual text below empty line not displayed.
Solution: Adjust flags and computations. (closes https://github.com/vim/vim/issues/11959)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 11 Feb 2023 15:00:04 +0100 |
parents | bd021eb62e73 |
children | d23645a0aca8 |
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 | 2 " Language: systemd.unit(5) |
3 " Keyword Lookup Support: Enno Nagel <enno.nagel+vim@gmail.com> | |
7176
30042ddff503
commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 |
30042ddff503
commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 if !exists('b:did_ftplugin') |
30042ddff503
commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 " Looks a lot like dosini files. |
30042ddff503
commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 runtime! ftplugin/dosini.vim |
30042ddff503
commit https://github.com/vim/vim/commit/60cce2fb736c8ff6fdb9603f502d3c15f1f7a25d
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 endif |
20115 | 9 |
10 if !has('unix') | |
11 finish | |
12 endif | |
13 | |
14 if !has('gui_running') | |
15 command! -buffer -nargs=1 Sman silent exe '!' . KeywordLookup_systemd(<q-args>) | redraw! | |
16 elseif has('terminal') | |
17 command! -buffer -nargs=1 Sman silent exe 'term ' . KeywordLookup_systemd(<q-args>) | |
18 else | |
19 finish | |
20 endif | |
21 | |
22 if !exists('*KeywordLookup_systemd') | |
23 function KeywordLookup_systemd(keyword) abort | |
24 let matches = matchlist(getline(search('\v^\s*\[\s*.+\s*\]\s*$', 'nbWz')), '\v^\s*\[\s*(\k+).*\]\s*$') | |
25 if len(matches) > 1 | |
26 let section = matches[1] | |
27 return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd.' . section | |
28 else | |
29 return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd' | |
30 endif | |
31 endfunction | |
32 endif | |
33 | |
34 setlocal iskeyword+=- | |
35 setlocal keywordprg=:Sman | |
36 | |
37 if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin) | |
38 let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<' | |
39 else | |
40 let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' | |
41 endif |