如何让 Vim 对文件名进行正常(类似 Bash)的 tab 补全? [英] How do I make Vim do normal (Bash-like) tab completion for file names?

查看:31
本文介绍了如何让 Vim 对文件名进行正常(类似 Bash)的 tab 补全?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在 Vim 中打开一个新文件并使用 Tab 补全时,它会补全整个文件名,而不是像 Bash 那样进行部分匹配.有没有一个选项可以让这个文件名选项卡完成更像 Bash?

When I'm opening a new file in Vim and I use tab completion, it completes the whole file name instead of doing the partial match like Bash does. Is there an option to make this file name tab completion work more like Bash?

推荐答案

我个人使用

set wildmode=longest,list,full
set wildmenu

当您键入第一个 Tab 键时,它会尽可能完整.第二个选项卡命中将提供一个列表.第三个和后续选项卡将循环显示完成选项,因此您无需其他键即可完成文件.

When you type the first tab hit, it will complete as much as possible. The second tab hit will provide a list. The third and subsequent tabs will cycle through completion options so you can complete the file without further keys.

Bash-like 就是

Bash-like would be just

set wildmode=longest,list 

但是full很方便.

这篇关于如何让 Vim 对文件名进行正常(类似 Bash)的 tab 补全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆