0

The vim plugin ctrl p only works for me into git repo.

Why does it need a .git file?

Be work i mean it is searching my entire machine when no .git file is found.

my settings

let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_match_window = 'top,order:ttb,min:1,max:30,results:30'
let g:ctrlp_custom_ignore = 'node_modules\|vendor/|DS_Store\|git'
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.idea/*,*/.DS_Store,*/vendor

Also tried:

let g:ctrlp_working_path_mode = 'r'
let g:ctrlp_working_path_mode = 'c'

1 Answers1

1

I'm not entirely sure what you are after, it sounds like you want ctrlp to pick up all files system wide and not just the "project" root directory.

The g:ctrlp_working_path_mode flags you set would either tell ctrlp c - only show me files from current loaded buffers directory including subdirectories, or r the first project root directory as identified with some sort of hidden repository directory like .git. Neither of which suggests what I think you are asking for...

So I'll go out of a limb and suggest that you can probably update the global variable:

let g:ctrlp_cmd = 'CtrlP /'

To look for all files, on a linux system. As detailed in the reader:

Run :CtrlP or :CtrlP [starting-directory] to invoke CtrlP in find file mode.

Or test the above with CtrlP / in command mode first.

Again, I've guessed what you wanted here...

110100100
  • 169
  • 4
  • You mean that ctrl p looks for the first hidden folder and searches from there. Okay, I get it now. I am new to vim and I didn't understand why ctrl p was searching everywhere on my machine. – Sebastian Tramper Apr 01 '20 at 17:59
  • No worries, glad it helped. Welcome to VIM, it's super fun! – 110100100 Apr 01 '20 at 19:03