打开文件时vim命令行完成

时间:2009-12-01 14:54:55

标签: vim

如何让VIM始终在命令模式下自动完成文件名?当我键入例如“:cd / ww [Tab]”时它工作正常,但如果我想打开一个文件并输入“:o / ww [Tab]”,它会插入“^ I”字符而不是完成。< / p>

2 个答案:

答案 0 :(得分:6)

尝试:

:e /ww[Tab]

答案 1 :(得分:1)

使用“:e”或“:split”或其他编辑命令代替“:o”。

Bonus事实:vim并不真正支持“:o”命令,至少不是根据文档。 “:help:o”说:

   
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.