Skip to content

Commit

Permalink
Use ag instead of ack
Browse files Browse the repository at this point in the history
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
Gabe Berke-Williams committed Mar 2, 2013
1 parent 99c8831 commit 1f4e6d1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
10 changes: 0 additions & 10 deletions ackrc

This file was deleted.

3 changes: 3 additions & 0 deletions agignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
log
tags
tmp
2 changes: 1 addition & 1 deletion bin/replace
Original file line number Diff line number Diff line change
Expand Up @@ -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"
9 changes: 4 additions & 5 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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-^>
Expand Down
2 changes: 1 addition & 1 deletion zsh/completion/_ack → zsh/completion/_ag
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#compdef ack
#compdef ag

if (( CURRENT == 2 )); then
if [[ -a tmp/tags ]]; then
Expand Down

0 comments on commit 1f4e6d1

Please sign in to comment.