In vim, I want to create a new command that takes a file-name as its single argument.
Is there a way to create such a command, so that the file-name-completion-magic (using tab) will work?
Just use -complete=file in the command arguments.
:help :command-completion
For example:
:command -complete=file -nargs=1 OpenFile e <args>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With