views:

132

answers:

1

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?

+3  A: 

Just use -complete=file in the command arguments.

:help :command-completion

For example:

:command -complete=file -nargs=1 OpenFile e <args>
Al