From cf624303b54510e9127acd7d6fbb947e4cb7d7f7 Mon Sep 17 00:00:00 2001 From: Derek Prior Date: Thu, 12 Mar 2015 09:56:34 -0400 Subject: [PATCH] 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`. --- agignore | 1 + vimrc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/agignore b/agignore index 2243475..64b0bcb 100644 --- a/agignore +++ b/agignore @@ -1,3 +1,4 @@ log tags tmp +.git/ diff --git a/vimrc b/vimrc index 8ef2669..0e4f7ee 100644 --- a/vimrc +++ b/vimrc @@ -68,7 +68,7 @@ if executable('ag') set grepprg=ag\ --nogroup\ --nocolor " 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 let g:ctrlp_use_caching = 0