Search code examples
vimautocompletesubstitution

Vim - how to auto complete buffer contents in command-line mode


Use case: I have a buffer

variable1
variable2
variable3

i want to replace variable1 with variable3 using

:%s/vari<TAB>/vari<TAB><TAB><TAB>

can this be done somehow? I don't want to have to type out or manually copy words


Solution

  • I vaguely remembered this old plugin from way back and, well… it still seems to do the job:

    compl