vim-logrotate/ftplugin/logrotate.vim

30 lines
781 B
VimL
Raw Normal View History

2022-10-26 21:57:54 -04:00
vim9script
# Vim filetype plugin file
2022-10-27 12:52:47 -04:00
# Language: logrotate
2022-10-26 21:57:54 -04:00
#
if exists("b:did_ftplugin")
2022-11-01 22:44:06 -04:00
finish
2022-10-26 21:57:54 -04:00
endif
b:did_ftplugin = 1
2022-10-27 13:53:24 -04:00
b:undo_ftplugin = "setlocal comments< commentstring< formatoptions< omnifunc<"
2022-10-26 21:57:54 -04:00
2022-10-27 13:53:24 -04:00
var awkcmd: string
2022-10-26 21:57:54 -04:00
2022-10-27 13:53:24 -04:00
if exists("g:logrotate_awk")
awkcmd = g:logrotate_awk
else
2022-11-01 22:44:06 -04:00
# Have to use gawk, default awk (i.e. mawk) does not support {0,7} regex syntax
2022-10-27 13:53:24 -04:00
awkcmd = "gawk"
endif
2022-11-01 22:44:06 -04:00
2022-12-30 23:11:32 -05:00
if has("patch-8.2.4770") && awkcmd != "disable" && executable(awkcmd)
2022-10-27 13:53:24 -04:00
2022-12-30 23:11:32 -05:00
command -nargs=1 LogRotateHelp :call g:logrotate#LogrotateHelp(awkcmd, <f-args>)
setlocal keywordprg=:LogRotateHelp
2022-10-27 13:53:24 -04:00
b:undo_ftplugin = b:undo_ftplugin .. " keywordprg<"
endif
2022-10-26 21:57:54 -04:00
2022-10-27 13:53:24 -04:00
setlocal omnifunc=syntaxcomplete#Complete
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql