romaninsh
romaninsh

Reputation: 10664

Configure tab to show list of variants instead of cycling through in VIM

When opening new buffer it VIM, I type:

new /path/to/fi

If I hit "tab" at this point it cycles through files. How to configure VIM to show list of variants instead of going for the first one?

Upvotes: 5

Views: 242

Answers (4)

Doug
Doug

Reputation: 3149

Control-P (ctrlp.vim) is a replacement for Command-T written in VimScript, so it doesn't require Ruby.

Upvotes: 0

romainl
romainl

Reputation: 196781

set wildmenu

Is all you need to add to your .vimrc. Read :help wildmenu.

Upvotes: 5

Rook
Rook

Reputation: 62558

Set your wildmode setting to something different, for example

set wildmode=list:longest

If I misunderstood the question completely, yell ... :)

Upvotes: 5

Rob Wouters
Rob Wouters

Reputation: 16327

(This is not a direct answer to your question, but I think it's even better :)

You should check out the Command-T plugin, inspired by TextMate's 'Go To File'. It filters out possible combinations very intelligently, just type a few characters of each subdirectory enough to distinguish it and it 'gets' it, the characters don't have to be at the beginning and can don't have to be sequential. It also shows you a list of options left.

I realize this is a terrible explanation so check out this video to see how it works.

The downside is it requires Vim to be compiled with Ruby support.

Upvotes: 1

Related Questions