ctrlpvim / ctrlp.vim

Active fork of kien/ctrlp.vim—Fuzzy file, buffer, mru, tag, etc finder.
ctrlpvim.github.com/ctrlp.vim
Other
5.56k stars 259 forks source link

"If a custom listing command is being used, exclusions are ignored" #496

Open Zundrium opened 5 years ago

Zundrium commented 5 years ago

Since normally a g:custom_user_command doesn't support wildignore. I found a dirty workaround that might do the job for some people other than me:

set wildignore=*.meta,*.asset,*.mat

let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files . --cached --exclude-standard --others | grep -Ev "' . substitute(&wildignore,',','|', 'g') . '"']

It's probably pretty bad for larger solutions but having a seperate .ignore file for every project is a no-go for me. The grep part might actually work for other finders as well.

What do you guys think? Is there a better way?

mattn commented 5 years ago

If ctrlp_user_command returns a lot of lines, it may be ignored by ctrlp's ctrlp_custom_ignore. The ignoring option should be given to ctrlp_user_command it self.