开发者

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.


Try:

:e /ww[Tab]


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.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜