Enabling file name completion in the new vim command

In vim, I want to create a new command that takes a file name as a single argument.
Is there a way to create such a command so that work with name-completion-magic (using a tab) works?

+3
source share
1 answer

Just use -complete=filecommands in the arguments.

:help :command-completion

For example:

:command -complete=file -nargs=1 OpenFile e <args>
+8
source

Source: https://habr.com/ru/post/1713827/


All Articles