There is some way to "extend" autocomplete functionality (like that one supplied by SuperTab plugin) to be used in command line mode so I would autocomplete when searching a text with / command?


When editing a text, in INSERT mode, I use now superTab plugin, so hitting TAB, a menu appear with possible completions items.

I'm looking for a similar feature when searching or editing in command mode (:command) and/or in serach mode (/searchedtext), with autocompletion, retrieving from file text words (ore previous commands!).

E.g. if I have the word validate_first and validate_firstname inside the file, I would like to have an autocompletion menu when hitting /validate, with items:

  • validate_first
  • validate_firstname

enter image description here

  • Could you add an example of what you currently do? And what you would like it to do? – StandardEyre Apr 6 '17 at 17:52
  • question updated; more clear now? :) – Giorgio Robino Apr 6 '17 at 19:55

I do not provide an autocompletion solution, but a way of filling your history with terms and then cycling through the terms:

Previous commands can be retrieved with the :his[tory] command

Previous searches can be retrieved with the :his[tory] / command

If you have incsearch enabled, you can search for (e.g.) /valid which will take you to the first match (perhaps validate_firstname). Pressing CTRL-L will add one character from after the current match to the command line. This is not the same as autocomplete with TAB but it does complete the search term.

You can then use :his / to find and repeat previous searches.

Once you have /validate_firstname and /validate in the search history, you can type /val followed by the <Up> and <Down> cursor keys to cycle through the search history.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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