Let ctrl-p find files with a leading dot

I am constantly forgetting that I can't use `ctrl-p` to open
`.travis.yml` or any other file with a leading `.`. This change comes
about after some discussion in general on how to handle this. Passing
`--hidden` to the `ag` command allows it to find files with a leading
`.`.

Unfortunately, this also includes the content of your `.git`
directory. To overcome this, we add `/.git/` to `agignore`.
This commit is contained in:
Derek Prior 2015-03-12 09:56:34 -04:00
parent 2eb9145f6b
commit cf624303b5
No known key found for this signature in database
GPG key ID: 60D9C7F1019704B4
2 changed files with 2 additions and 1 deletions

View file

@ -1,3 +1,4 @@
log log
tags tags
tmp tmp
.git/

2
vimrc
View file

@ -68,7 +68,7 @@ if executable('ag')
set grepprg=ag\ --nogroup\ --nocolor set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' let g:ctrlp_user_command = 'ag %s -l --nocolor --hidden -g ""'
" ag is fast enough that CtrlP doesn't need to cache " ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0 let g:ctrlp_use_caching = 0