Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim in ex-command mode, how to complete the path only up to the first non unique match?

I'm in a directory with many subfolders with a common prefix:

./pref-apple
./pref-aubergine
./pref-mango
./pref-milk

I have a file in one of these folder and I want vim to auto-complete the path just up to the first non-ambiguous match

:e ./p<TAB> -> :e ./pref-

:e ./pref-au<TAB> -> :e ./pref-aubergine/

while at the moment it will auto-complete with the full first folder-name. :e ./p<TAB> -> :e/pref-apple/

How can I do that?

like image 775
acorello Avatar asked Apr 06 '11 15:04

acorello


People also ask

What does C mean in vim?

In Vim (and Emacs) documentation, C- and M- stand for Ctrl and Meta (i.e. Alt ) respectively. So C-O is Ctrl O .

How to go to command mode in vim?

To go back to COMMAND mode, you type the esc key. vim starts out in COMMAND mode. Over time, you will likely spend more time in COMMAND mode than INSERT mode.

What does Silent mean in vim?

<silent> tells vim to show no message when this key sequence is used. <leader> means the key sequence starts with the character assigned to variable mapleader -- a backslash, if no let mapleader = statement has executed yet at the point nmap executes.

How to switch between modes in vim?

Changing the modes The most commonly used command to enter in to insert mode is “i”. To shift back to normal mode, press Esc. To switch to the visual mode from Normal mode, different commands are v, V, Shift + v, and Ctrl + v. The most commonly used command to enter in to insert mode is “v”.


1 Answers

You want to set wildmode=longest.

More info at :help 'wildmode'

like image 179
intuited Avatar answered Sep 28 '22 15:09

intuited