Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use Silver Searcher as CtrlP backend

* Use `ag` as the find method for listing files in CtrlP Vim plugin
* ag indexes and searches far faster than the native engine
* ag also respects .gitignore files on on a per-directory basis, avoiding duplication
  • Loading branch information...
commit f854c8d8ef08ab0f80639e0219f9800f0246fb90 1 parent 64e6dfa
Adarsh Pandit authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 vimrc
11 vimrc
@@ -59,10 +59,13 @@ set expandtab
" Display extra whitespace
set list listchars=tab:»·,trail:·
-" Use Ag ( instead of Grep when
-" available
-if executable("ag")
- set grepprg=ag\ --nogroup\ --nocolor
+" Use The Silver Searcher
+if executable('ag')
+ " Use Ag over Grep
+ 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 ""'
" Color scheme

5 comments on commit f854c8d


What's with the double-escaped spaces there? I get errors unless I just single-escape them.


@adamyonk - these work fine for me on zsh, OS X 10.8.4.

What errors are you seeing?


I think that maybe we can make it a single \ since that's what it was before. I'm guessing other shells, operating systems may not like the double \.


Fixed in #163

Please sign in to comment.
Something went wrong with that request. Please try again.