使用 xterm 在 vim 中完成文件名无法按预期工作
我的 vim
发生了一些有趣的事情。我通过 xterm 使用它。我希望能够自动完成我尝试打开的文件名。
例如:
# Cursor is | character
:o exam|
:o exam|<TAB>
:o examplefile.txt|
我确信 vim 支持此功能,但它对我不起作用。当我点击
时,会插入 ^I
字符而不是完成文件名:
:o exam|<TAB>
:o exam^I|
:o exam^I|<TAB>
:o exam^I^I|
但是,xterm
的 bash
中工作正常 - 它正确地完成文件名并且不会扩展为 ^I
。
我的终端配置不正确吗?我需要一些stty
巫术吗?或者完全是另外一回事?
编辑
:e
确实对我有用 - 似乎只有 :o
不起作用...
Something funny is going on with my vim
. I'm using it through xterm
. I want to be able to autocomplete filenames that I try to open.
For example:
# Cursor is | character
:o exam|
:o exam|<TAB>
:o examplefile.txt|
I was sure vim
supported this, but it's not working for me. When I hit <TAB>
an ^I
character is inserted instead of completing the filename:
:o exam|<TAB>
:o exam^I|
:o exam^I|<TAB>
:o exam^I^I|
However, <TAB>
works fine in bash
in xterm
- it correctly completes filenames and doesn't expand to ^I
.
Is my terminal configured incorrectly? Do I need some stty
voodoo? Or is it something else entirely?
Edit
:e
does work for me - seems like only :o
doesn't...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
vim 中并不真正支持 :o。尝试输入 :h :o,你会看到:
我认为你混淆了 :o 和 :e (它们不一样)。
:o is not really supported in vim. Try typing :h :o, you'll see this:
I think you're confusing :o and :e (they're not the same).
edit
对我有用:edit
works for me: