29
votes

When I type a command in Vim, for example opening a file, I start to type the file name, and I want to press Tab and have Vim autocomplete the name. However, when I press Tab, vim puts in ^I for some reason.

How can I make Vim tab complete?

2

2 Answers

27
votes

The character which starts command-line completion defaults to Tab only when nocompatible is set. In Vi compatible mode it's CTRL-E.

This is documented in :h cmdline-completion.

You can set nocompatible in your .vimrc file to make it work as expected.

11
votes

If you want to do stuff like omni-completion, you can also open the command line in a window by typing q: in normal mode or CTRL-F as you're typing your command.

command line view

Same goes with /finding_patterns with q/ and q?