diff --git a/ftplugin/logrotate.vim b/ftplugin/logrotate.vim index 899e3a6..e197b4d 100644 --- a/ftplugin/logrotate.vim +++ b/ftplugin/logrotate.vim @@ -13,7 +13,7 @@ def LogrotateHelp(msg: string = expand("")) gawk '/^CONFIGURATION FILE DIRECTIVES/,/^SCRIPTS/' | gawk ' /^ {7}%s/,/^[a-z]/ { if(firstLineDone) { - if(/^ {7}[^ ]/ || /^[A-Z]/) + if(/^ {0,7}[^ ]/ && !/endscript/) exit } firstLineDone = 1 diff --git a/syntax/logrotate.vim b/syntax/logrotate.vim index ad2950d..6be84ba 100644 --- a/syntax/logrotate.vim +++ b/syntax/logrotate.vim @@ -6,6 +6,12 @@ if exists("b:current_syntax") finish endif +syn region logRotateScript matchgroup=logRotateKeyword start="\s*\" end="\" contains=NONE +syn region logRotateScript matchgroup=logRotateKeyword start="\s*\" end="\" contains=NONE +syn region logRotateScript matchgroup=logRotateKeyword start="\s*\" end="\" contains=NONE +syn region logRotateScript matchgroup=logRotateKeyword start="\s*\" end="\" contains=NONE +syn region logRotateScript matchgroup=logRotateKeyword start="\s*\" end="\" contains=NONE + runtime! syntax/conf.vim " syn keyword logRotateTodo contained TODO FIXME XXX @@ -34,4 +40,6 @@ hi def link logRotateKeyword Keyword " hi def link logRotateComment Comment " hi def link logRotateTodo Todo +hi def link logRotateScript Function + let b:current_syntax = 'logrotate'