ctrlp.vim icon indicating copy to clipboard operation
ctrlp.vim copied to clipboard

Use CtrlP on custom root directories

Open DevonVille opened this issue 14 years ago • 4 comments

Is there a way to do this? for example, I want CtrlP to source only files in /var/www/myproject/bla/bla/theme, whereas the .git directory is located in /var/www/myproject.

I know there's a script called local_vimrc, in which I can define various customizations to the original vimrc. Maybe in the local file I can somehow define that ctrlp will only source files from this directory?

The only other option I can think of, which is a poor-man-solution, is faking a .git directory in the directory.

DevonVille avatar Oct 03 '12 14:10 DevonVille

You can use :CtrlP /var/www/myproject/bla/bla/theme.

kien avatar Oct 03 '12 18:10 kien

How would you do :CtrlP /var/www/myproject/bla/bla/theme in .vimrc?

AlexAllocated avatar Feb 12 '14 23:02 AlexAllocated

You could do something like

noremap <C-P> <Esc>:CtrlP /var/www/myproject/bla/bla/theme<CR>

positron avatar Feb 13 '14 03:02 positron

Yeah I figured I could do that, but I meant how do I set that root directory manually in the .vimrc so that it uses that root every time instead of just when I manually invoke the CtrlP command.

AlexAllocated avatar Feb 13 '14 03:02 AlexAllocated