When I’m working in vim, I usually have multiple buffers on screen at once and need to switch between them and open new files a lot. I’ve installed the Command-T plugin to facilitate fast file switching but I’m having a few issues with it.
Whenever I press Command-T, it only shows files in the same folder (and sub folders) of the file I am currently editing.
I want it to show me all of the files in my project i.e.:
Project Folder:
~/project1/
Current Buffer:
~/project1/front/js/file1.js
When I press Command+T in the buffer, I want it to display files starting from the project folder.
Thanks.
The problem you have is because CommandT searches in present working directory. You can see what your working directory is with the
:pwdcommand. When you open a file with the gui it sets your present working directory to the directory that file contains. As romainl said you can simply:cdinto your project’s root directory and then CommandT will search from there (remember to:CommandTFlush)Alternatively you could use ctrl-p (which I personally prefer since it doesn’t require compiling a C helper program). It has an option
ctrlp_working_path_modeoption changes the working directory to the first ancestor that contains one of the following directories or files: