cornelis
cornelis copied to clipboard
Tab completion for simplification modes
Set a CmdComplete
CommandOption
, and then follow the docs:
The following example lists user names to a Finger command
:com -complete=custom,ListUsers -nargs=1 Finger !finger <args>
:fun ListUsers(A,L,P)
: return system("cut -d: -f1 /etc/passwd")
:endfun
The following example completes filenames from the directories specified in
the 'path' option:
:com -nargs=1 -bang -complete=customlist,EditFileComplete
\ EditFile edit<bang> <args>
:fun EditFileComplete(A,L,P)
: return split(globpath(&path, a:A), "\n")
:endfun