Andrey
Andrey

Reputation: 1110

vim command line completion when opening files

How to make VIM to always auto-complete filenames in command mode? It works fine when I type for example ":cd /ww[Tab]", but if I want to open a file and type ":o /ww[Tab]", it inserts "^I" character instead of completing.

Upvotes: 4

Views: 616

Answers (2)

svec
svec

Reputation: 3487

Use ":e" or ":split" or other edit commands instead of ":o".

Bonus fact: vim doesn't really support the ":o" command, at least not according to the docs. ":help :o" says this:

   
This command is in Vi, but Vim only simulates it:

                                *:o* *:op* *:open* :[range]o[pen]
                                Works like |:visual|: end Ex mode.
                                {Vi: start editing in open mode}

:[range]o[pen] /pattern/        As above, additionally move the cursor to the
                                column where "pattern" matches in the cursor
                                line.

Vim does not support open mode, since it's not really useful.
For those situations where ":open" would start open mode Vim will
leave Ex mode, which allows executing the same commands, but updates 
the whole screen instead of only one line.

Upvotes: 1

Arkaitz Jimenez
Arkaitz Jimenez

Reputation: 23198

Try:

:e /ww[Tab]

Upvotes: 6

Related Questions