开发者

Recursive Tab Complete Filenames on :edit in VIM

I had found a .vimrc configuration that allowed me to simply type

:e <<characters_in_filename>> 

and then tab and the path would expand out to :e full_path or show me a list of options if there are similarly named files in my current path.

Anyone know how to make this happen?

note: I'm aware of FuzzyFileFinder, Peepopen, and CommandT, this has just really been bothering me.

It's very simila开发者_运维问答r to the functionality described in this google groups thread


As ZyX said, it sounds like you want find.

set wildmenu
set wildmode=longest:full
set path+=./**

If you type :find so<Tab>, it will complete with all files that start with so searching recursively from the current file's directory (not pwd). (<Tab> can be changed with wildchar.)

You may prefer this kind of completion:

set wildmode=list:longest

And you could add your often used roots to path if you don't want recursive from the current file's directory.

set path+=~/code/**

If you just want to recurse from the current directory, try the above wild settings and use:

:edit **/so<Tab>

For more on specifying filenames see :help {file} and for more on **, see :help starstar-wildcard.


Be sure that wildmenu is on and try :find command.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜