You've already forked vim-logrotate
move function to autoload
This commit is contained in:
19
autoload/logrotate.vim
Normal file
19
autoload/logrotate.vim
Normal file
@ -0,0 +1,19 @@
|
||||
vim9script
|
||||
|
||||
export def LogrotateHelp(awkcmd: string, word: string)
|
||||
|
||||
const searchcmd =<< trim eval END
|
||||
echo "<=== man logrotate ===>"
|
||||
COLUMNS=80 man logrotate 2>/dev/null |
|
||||
{awkcmd} '/^CONFIGURATION FILE DIRECTIVES/,/^SCRIPTS/' | {awkcmd} '
|
||||
/^ {{7}}{word}/,false {{
|
||||
if(firstLineDone && /^ {{0,7}}[^ ]/ && !/endscript/) exit
|
||||
firstLineDone = 1
|
||||
print(substr($0, 8))
|
||||
}}'
|
||||
END
|
||||
searchcmd
|
||||
->join("\n")
|
||||
->systemlist()
|
||||
->popup_atcursor({ "padding": [0, 1, 1, 1] })
|
||||
enddef
|
Reference in New Issue
Block a user