cleanup and add FIXME
This commit is contained in:
parent
23f344fb75
commit
714801b466
@ -17,18 +17,20 @@ else
|
|||||||
awkcmd = "gawk"
|
awkcmd = "gawk"
|
||||||
endif
|
endif
|
||||||
# Have to use gawk, default awk (mawk) does not support {0,7} syntax
|
# Have to use gawk, default awk (mawk) does not support {0,7} syntax
|
||||||
if executable(awkcmd)
|
if awkcmd != "disable" && executable(awkcmd)
|
||||||
def LogrotateHelp(word: string)
|
def LogrotateHelp(word: string)
|
||||||
const searchcmd =<< trim eval END
|
const searchcmd =<< trim eval END
|
||||||
|
echo "<=== man logrotate ===>"
|
||||||
COLUMNS=80 man logrotate 2>/dev/null |
|
COLUMNS=80 man logrotate 2>/dev/null |
|
||||||
{awkcmd} '/^CONFIGURATION FILE DIRECTIVES/,/^SCRIPTS/' | {awkcmd} '
|
{awkcmd} '/^CONFIGURATION FILE DIRECTIVES/,/^SCRIPTS/' | {awkcmd} '
|
||||||
/^ {{7}}%s/,false {{
|
/^ {{7}}{word}/,false {{
|
||||||
if(firstLineDone && /^ {{0,7}}[^ ]/ && !/endscript/) exit
|
if(firstLineDone && /^ {{0,7}}[^ ]/ && !/endscript/) exit
|
||||||
firstLineDone = 1
|
firstLineDone = 1
|
||||||
print(substr($0, 8))
|
print(substr($0, 8))
|
||||||
}}'
|
}}'
|
||||||
END
|
END
|
||||||
printf(join(searchcmd, "\n"), word)
|
searchcmd
|
||||||
|
->join("\n")
|
||||||
->systemlist()
|
->systemlist()
|
||||||
->popup_atcursor({ "padding": [0, 1, 1, 1] })
|
->popup_atcursor({ "padding": [0, 1, 1, 1] })
|
||||||
enddef
|
enddef
|
||||||
|
@ -8,6 +8,10 @@ endif
|
|||||||
syntax include @logRotateSh syntax/sh.vim
|
syntax include @logRotateSh syntax/sh.vim
|
||||||
unlet b:current_syntax
|
unlet b:current_syntax
|
||||||
|
|
||||||
|
" FIXME:
|
||||||
|
" Whitespace is not required in actual config,
|
||||||
|
" But vim syntax region does not work if start pattern is also a keyword
|
||||||
|
" Hence added \s* below
|
||||||
syntax region logRotateScript matchgroup=logRotateKeyword start="\s*\<\%(firstaction\|lastaction\|prerotate\|postrotate\|preremove\)\>" end="\<endscript\>" contains=@logRotateSh
|
syntax region logRotateScript matchgroup=logRotateKeyword start="\s*\<\%(firstaction\|lastaction\|prerotate\|postrotate\|preremove\)\>" end="\<endscript\>" contains=@logRotateSh
|
||||||
|
|
||||||
" for comments, todo, string
|
" for comments, todo, string
|
||||||
|
Loading…
Reference in New Issue
Block a user