Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 280
romaninsh Avatar asked Jan 21 '12 19:01

romaninsh


3 Answers

set wildmenu

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

like image 123
romainl Avatar answered Nov 15 '22 03:11

romainl


Set your wildmode setting to something different, for example

set wildmode=list:longest

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

like image 5
Rook Avatar answered Nov 15 '22 02:11

Rook


(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.

like image 1
Rob Wouters Avatar answered Nov 15 '22 03:11

Rob Wouters