The main project I work on is split up into multiple git projects. I'd like to be able to Ctrl-P search for files in a different project than the one I'm currently in, but as far as I can tell, I can't make Ctrl-P search anything other than the current git project (since it stops when it finds the .git ancestor).

Is there a way to tell Ctrl-P to search in multiple .git projects?

  • Did you read the doc?
    – romainl
    Commented Mar 25, 2015 at 13:00
  • ctrlp-root-markers might help him as well
    – Matt Boehm
    Commented Mar 25, 2015 at 15:06

1 Answer 1


There are a few options depending on the layout of directories.

If all these repos are contained in a single root folder that you want to search, then you can search that directory explicitly by running :CtrlP myproject. Alternatively, I believe you could say let g:ctrlp_root_markers=['.root'] and make a .root file in the root (myproject) directory.

If for some strange reason you can't put all these directories in one root, you could make a directory somewhere else, put symlinks in it to all the directories you want searched, put let g:ctrlp_follow_symlinks=1 in your .vimrc, and explicitly tell CtrlP to use this directory when running (:CtrlP mynewroot).

Failing that, you could modify ctrlp_user_command, but doing so gets complicated and will ignore other ctrlp settings.

  • Thanks :CtrlP myproject was what I needed. Note to anyone else looking at this, myproject is the path to the directory that you want to use as your parent.
    – kash
    Commented Mar 25, 2015 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.