embed script has syntax highlight

This commit is contained in:
2022-10-27 12:52:47 -04:00
parent 4849640ef1
commit 9eb422ba89
2 changed files with 10 additions and 11 deletions

View File

@ -1,13 +1,13 @@
vim9script
# Vim filetype plugin file
# Language: confini
# Language: logrotate
#
if exists("b:did_ftplugin")
finish
endif
b:did_ftplugin = 1
def LogrotateHelp(msg: string = expand("<cword>"))
def LogrotateHelp(word: string)
const searchcmd =<< trim END
COLUMNS=80 man logrotate 2>/dev/null |
gawk '/^CONFIGURATION FILE DIRECTIVES/,/^SCRIPTS/' | gawk '
@ -20,13 +20,13 @@ def LogrotateHelp(msg: string = expand("<cword>"))
print(substr($0, 8))
}'
END
printf(join(searchcmd, "\n"), expand("<cword>"))
printf(join(searchcmd, "\n"), word)
->systemlist()
->popup_atcursor({ "padding": [0, 1, 1, 1] })
enddef
command -nargs=1 LogRt :call LogrotateHelp(<f-args>)
b:undo_ftplugin = "setlocal commentstring< formatoptions< keywordprg<"
b:undo_ftplugin = "setlocal comments< commentstring< formatoptions< keywordprg<"
setlocal commentstring=#\ %s formatoptions-=t formatoptions+=croql keywordprg=:LogRt
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql keywordprg=:LogRt