Browse files

Use ag instead of ack

https://github.com/ggreer/the_silver_searcher

* ag is faster than ack
* ag searches all files by default (but still ignores gitignored files). This
  removes the need for ack's `--type-add=` options.
* The command is 33% shorter than ack!
  • Loading branch information...
1 parent 99c8831 commit 1f4e6d137097591c16934706899fd1ba576cf9a1 @gabebw gabebw committed Feb 28, 2013
Showing with 9 additions and 17 deletions.
  1. +0 −10 ackrc
  2. +3 −0 agignore
  3. +1 −1 bin/replace
  4. +4 −5 vimrc
  5. +1 −1 zsh/completion/{_ack → _ag}
View
10 ackrc
@@ -1,10 +0,0 @@
-# Search
---type-set=coffee=.coffee
---type-set=cucumber=.feature
---type-set=haml=.haml
---type-set=sass=.sass,.scss
-
-# Don't search
---ignore-dir=log
---ignore-dir=tags
---ignore-dir=tmp
View
3 agignore
@@ -0,0 +1,3 @@
+log
+tags
+tmp
View
2 bin/replace
@@ -9,4 +9,4 @@ shift
replace_with=$1
shift
-ack -l $find_this $* | xargs sed -i '' "s/$find_this/$replace_with/g"
+ag -l $find_this $* | xargs sed -i '' "s/$find_this/$replace_with/g"
View
9 vimrc
@@ -73,9 +73,10 @@ if filereadable(".vimrc.local")
source .vimrc.local
endif
-" Use Ack instead of Grep when available
-if executable("ack")
- set grepprg=ack\ -H\ --nogroup\ --nocolor
+" Use Ag (https://github.com/ggreer/the_silver_searcher) instead of Grep when
+" available
+if executable("ag")
+ set grepprg=ag\ --noheading\ --nogroup\ --nocolor
endif
" Color scheme
@@ -114,8 +115,6 @@ map <Leader>ct :!ctags -R .<CR>
" Cucumber navigation commands
autocmd User Rails Rnavcommand step features/step_definitions -glob=**/* -suffix=_steps.rb
autocmd User Rails Rnavcommand config config -glob=**/* -suffix=.rb -default=routes
-" :Cuc my text (no quotes) -> runs cucumber scenarios containing "my text"
-command! -nargs=+ Cuc :!ack --no-heading --no-break <q-args> | cut -d':' -f1,2 | xargs bundle exec cucumber --no-color
" Switch between the last two files
nnoremap <leader><leader> <c-^>
View
2 zsh/completion/_ack → zsh/completion/_ag
@@ -1,4 +1,4 @@
-#compdef ack
+#compdef ag
if (( CURRENT == 2 )); then
if [[ -a tmp/tags ]]; then

0 comments on commit 1f4e6d1

Please sign in to comment.