Vim Autocompletion

May 12, 2018  

Vim has some really handy features that aren’t immediately apparent.

Autocompleting file paths

One of these is the ability to autocomplete / navigate paths - type all of the following keys while holding Control:

  • x then f: bring up the first file or path found
  • n: select the next entry
  • p: select the previous entry
  • Repeat x then f to recurse into the selected path
  • Press w to go back up a level

Autocompletion

Autocompletiong variables

You can also autocomplete a word that’s contained in the current file. This can be useful for method or variable autocompletion while programming.

To show a list of autocomplete options simply press Control + p or Control + n as with the file paths to select the previous or next match.