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?
In Vim (and Emacs) documentation, C- and M- stand for Ctrl and Meta (i.e. Alt ) respectively. So C-O is Ctrl O .
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.
<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.
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”.
You want to set wildmode=longest
.
More info at :help 'wildmode'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With