Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore .git directory in ctrlp.vim

Tags:

vim

ctrlp

In my .vimrc I have some custom ingores for ctrlp.vim. There are a few directories I want to ignore that start with a dot: .git is a good example. By having .git in the ignores, I also ignore individual files like git.sh. I only want to ignore .git. What am I doing wrong?

let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|bower_components\|.sass-cache\|.git\|build'
like image 285
rb- Avatar asked Jan 25 '15 17:01

rb-


1 Answers

You need to specify that .git is specifically a directory ignore. From the documentation's example: https://github.com/kien/ctrlp.vim

let g:ctrlp_custom_ignore = {
  \ 'dir':  '\v[\/]\.(git|hg|svn)$',
  \ 'file': '\v\.(exe|so|dll)$',
  \ 'link': 'some_bad_symbolic_links',
  \ }
like image 164
h7r Avatar answered Dec 18 '22 13:12

h7r