[英]Tab completion in Vim Commands
When I type a command in Vim, for example opening a file, I start to type the file name, and I want to press Tab and have Vim autocomplete the name. 当我在Vim中键入命令时,例如打开文件,我开始输入文件名,我想按Tab键让Vim自动填充名称。 However, when I press Tab, vim puts in
^I
for some reason. 但是,当我按Tab键时,vim因某种原因放入
^I
How can I make Vim tab complete? 如何让Vim标签完整?
The character which starts command-line completion defaults to Tab only when nocompatible
is set. 仅当设置了
nocompatible
时,启动命令行完成的字符默认为Tab 。 In Vi compatible mode it's CTRL-E . 在Vi兼容模式下,它是CTRL-E 。
This is documented in :h cmdline-completion . 这记录在:h cmdline-completion中 。
You can set nocompatible
in your .vimrc file to make it work as expected. 您可以在.vimrc文件中
set nocompatible
以使其按预期工作。
If you want to do stuff like omni-completion, you can also open the command line in a window by typing q:
in normal mode or CTRL-F
as you're typing your command. 如果你想做omni-completion之类的东西,你也可以通过在正常模式下键入
q:
或在输入命令时按CTRL-F
来打开窗口中的命令行。
Same goes with /finding_patterns
with q/
and q?
与
q/
和q?
/finding_patterns
相同q?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.