Vim plugin: CTRL-P
If you use just one Vim plugin, CTRL-P is my recommendation. In short, it lets you to quickly jump to a file.
First open the CTRL-P window with either of these methods:
- If you type
:CtrlPBuffer
, you can search among the currently open files. - If you type
:CtrlPMRU
, you can search among the most recently used files. (250 files are remembered by default.) - If you hit
Ctrl-P
, you can search among the files in the current project. The file list is created by moving upwards in the directory tree and looking for a file or directory that indicates that that directory is the project root (like.git
), and then listing all files below that project root (excluding files based on the'wildignore'
option).
Once you have the CTRL-P window with a list of files, just start typing parts of the file you are looking for. E.g. if you only remember that the file starts with “x” and contains “abc”, type “xabc”. After hitting each letter, the file list will be filtered. So in the end, the CTRL-P window will contain only files whose path+filename contains the letters “x”, “a”, “b” and “c” in this order. (They may contain any other letters in between.) If there are still several hits, you can either keep typing or select your file by using the up/down keys.