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).
I experienced similar problem. I found solution like:
And in VIM naviagte to file with in normal mode type:
When you are navigating in non-insert mode after !realpatch you are able to use our key button.
VOILA! TAB is working again!
There's ctrl-x ctrl-f
:he compl-filename
For file name omni completion, you can use:
Ctrl-XCtrl-F
To build on @CMS and @michael excellent answers
When using ctrl+X ctrl+f command sequence it will display a list of files in the current directory. I spend a minute looking for the right key to move up and down between the different filenames. The correct keys are Ctrl-n and Ctrl-p. You can use almost any other key (like Space) to select and continue typing.
In addition, if you are not already at the file/directory you would like to insert, you can go down a file tree structure as follows:
../../
for example!You can keep doing this until you find the directory/file you would like to insert in the document.