When in Vim insert mode, is there a way to add filepath autocompletion?

stephenmm picture stephenmm · Dec 17, 2009 · Viewed 30.8k times · Source

I write a lot of shell scripts and I am constantly having to enter in filepaths. I am wondering if anyone knows of a way to get Vim to autocomplete filepaths while in insert mode, just like when you are in your favorite shell you tab to complete the path of the directory or file.

Extra credit if you can get CTRLD functionality of the shell into Vim insert mode (i.e. to see what files/directories are in the current path).

Answer

Christian C. Salvadó picture Christian C. Salvadó · Dec 17, 2009

For file name omni completion, you can use:

Ctrl-XCtrl-F