Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use 'wildignore' in Vim?

Tags:

I'm having a lot of trouble figuring out the syntax for the wildignore setting in Vim.

Suppose I want my file finder plugin (I use Ctrlp, which uses wildignore) to not search through hidden files and folders, that is, files and folders prefixed with a ..

How would I go about doing that?

like image 371
Fawkes5 Avatar asked Aug 15 '12 22:08

Fawkes5


1 Answers

Concerning ctrlp.vim and wildignore specifically, if you type :help ctrlp-options and read a bit, you will find:

Note #1: by default, wildignore and g:ctrlp_custom_ignore only apply when globpath() is used to scan for files, thus these options do not apply when a command defined with g:ctrlp_user_command is being used.

Thus, you may need to unlet g:ctrlp_user_command (possibly set to a default command) to actually use wildignore. For instance, in your ~/.vimrc, add:

if exists("g:ctrl_user_command")     unlet g:ctrlp_user_command endif set wildignore+=.* 
like image 73
BenC Avatar answered Sep 18 '22 18:09

BenC