how to make vim's auto-complete behave like bash's default auto-complete?

14

5

When you type :e some/path/file<Tab> if there are several matches, vim just picks the first one and you have to cycle through the rest of them with the Tab key. (pretty much like the behavior of the Windows CLI).

How do I make it behave like bash where it only completes until there's ambiguity?

EDIT: updated question for a bit more clarity.

hasen

Posted 2009-09-13T04:48:42.010

Reputation: 4 556

http://stackoverflow.com/questions/5569348/vim-in-ex-command-mode-how-to-complete-the-path-only-up-to-the-first-non-unique – Ciro Santilli 新疆改造中心法轮功六四事件 – 2015-09-18T10:33:07.280

Answers

25

Add this to your .vimrc:

set wildmenu
set wildmode=list:longest

John T

Posted 2009-09-13T04:48:42.010

Reputation: 149 037

4I just signed up to superuser and answered questions so that I could get enough reputation to upvote your answer. Thankyou. – user138727 – 2012-06-07T16:11:19.190

-4

Pressing Tab multiple times steps through the matches.

You can omit set wildmenu since set wildmode=list:longest implies it.

Paused until further notice.

Posted 2009-09-13T04:48:42.010

Reputation: 86 075

3I know ... that's not the question – hasen – 2009-09-13T05:42:15.173