kien / ctrlp.vim

Fuzzy file, buffer, mru, tag, etc finder.
kien.github.com/ctrlp.vim
7.26k stars 676 forks source link

Can't make ctrlp_custom_ignore work #675

Open baruchel opened 9 years ago

baruchel commented 9 years ago

Hi, I can't make the option ctrlp_custom_ignore work. Since several issues on Github or Stackoverflow were about that, let me tell that I read all their answers carefully, read also the whole help, browsed the web, and spent hours trying to make it work without success. Here are some details:

a) I wan't all files with a path beginning with /tmp/ to be discarded (because currently 60% of ctrlp suggestions are my sent mail from my mail agent).

b) I don't use ctrlp_user_command at all. I finally added the following lines in my ~/.vimrc

if exists("g:ctrlp_user_command")
  unlet g:ctrlp_user_command
endif

in order to be sure, but I am absolutely certain that even before that ctrlp_user_command wasn't used.

c) Each time I try a new regexp for ctrlp_custom_ignore, I close all my running Vim sessions, have a check with ps ax | grep vim then delete by hand the cache folder with rm -Rf ~/.cache/ctrlp. Then I write a mail (with my mail agent launching vim for editing some /tmp/pico.XXXX file); then I start a new vim session, hit Ctrl-P and... see my recently /tmp/pico.XXXX file

d) My Vim is compiled with wildignore; I tried to achieve the same result with wildignore (though I would really like rather using ctrlp_custom_ignore) but I had no success with it either.

e) I tried many syntax for the regexp like:

let ctrlp_custom_ignore='tmp'
let ctrlp_custom_ignore='\/tmp'
let ctrlp_custom_ignore='^\/tmp.*$'
let ctrlp_custom_ignore='pico'

but no change could be noticed.

f) My current configuration for ctrlp is:

let g:ctrlp_regex = 1
let g:ctrlp_cmd='CtrlPMRU'
if exists("g:ctrlp_user_command")
  unlet g:ctrlp_user_command
endif
let g:ctrlp_custom_ignore='\/tmp'

Am I missing something? Is ctrlp_custom_ignore incompatible with CtrlPMRU?

baruchel commented 9 years ago

I reread the help and noticed that the MRU mode uses another variable. It seems t work now with:

let g:ctrlp_mruf_exclude = '/tmp/.*'

Best regards.

UkuLoskit commented 9 years ago

Hey! please note that this a unmaintained repo and maintained fork is at https://github.com/ctrlpvim/ctrlp.vim