Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to get Vim in command mode to complete words from the current file? Say I have this file:


and I enter command line mode

:myruncommand o|

where | denotes the cursor position. How do I make Vim complete one or once when pressing Tab?

share|improve this question
Quote from the script description: "In ':' mode, completion is available only after a '/'." Not really what I need. –  Nickolay Kolev Sep 20 '11 at 7:45

2 Answers 2

up vote 2 down vote accepted

It's not possible natively, but it took about one minute to find this script and this one on vim.org.

share|improve this answer

Completion is available if you enter history of command mode. Very handy to alter or repeat previously used commands.

Press q: in normal mode to enter command history pane.

See http://vim.wikia.com/wiki/Using_command-line_history for more details.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.