Skip to content

Commit cf62430

Browse files
committed
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`.
1 parent 2eb9145 commit cf62430

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

agignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
log
22
tags
33
tmp
4+
.git/

vimrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ if executable('ag')
6868
set grepprg=ag\ --nogroup\ --nocolor
6969

7070
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
71-
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
71+
let g:ctrlp_user_command = 'ag %s -l --nocolor --hidden -g ""'
7272

7373
" ag is fast enough that CtrlP doesn't need to cache
7474
let g:ctrlp_use_caching = 0

0 commit comments

Comments
 (0)