PyPanta

Freelance Developer

In VIM, you can use the find command to search for files in the current working directory path, this is by default. If you want to search in subdirectories also, you need to add them in the searching path, for example:

:set path+=myproject

Now, the find command will also search files in the myproject directory, which is in your current working directory (directory where you started the Vim editor).

If you have other directories in your CWD, add them in the path separated with the comma, for example:

:set path+=myproject,myotherprojectdir

Now, the find command will perform searching in both directories, but not in their subdirectories. For searching files in subdirectories, you can add them in the path like in the examples above, or you can use glob character instead of their names, for example:

:set path+=**/*

Now, the find command will perform searching in all directories and subdirectories in your CWD path.

Also, you must enter the full file name including the file extension, because VIM find command does not support filename expansion with glob characters like are * and ?, or regular expressions. But, you can set the wildmenu for TAB completion, so when you enter the first couple of characters of the file name, and then press the TAB, all files whose names begin with the entered characters will be listed at the bottom of the VIM window. Then use the TAB to circle between them, and press the ENTER when you find the right one.

You can set wildmenu with :set wildmenu or :set wmnu commad in the VIM command line.