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!
This commit is contained in:
parent
99c8831c94
commit
1f4e6d1370
5 changed files with 9 additions and 17 deletions
10
ackrc
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
|
|
3
agignore
Normal file
3
agignore
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
log
|
||||||
|
tags
|
||||||
|
tmp
|
|
@ -9,4 +9,4 @@ shift
|
||||||
replace_with=$1
|
replace_with=$1
|
||||||
shift
|
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
vimrc
9
vimrc
|
@ -73,9 +73,10 @@ if filereadable(".vimrc.local")
|
||||||
source .vimrc.local
|
source .vimrc.local
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Use Ack instead of Grep when available
|
" Use Ag (https://github.com/ggreer/the_silver_searcher) instead of Grep when
|
||||||
if executable("ack")
|
" available
|
||||||
set grepprg=ack\ -H\ --nogroup\ --nocolor
|
if executable("ag")
|
||||||
|
set grepprg=ag\ --noheading\ --nogroup\ --nocolor
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Color scheme
|
" Color scheme
|
||||||
|
@ -114,8 +115,6 @@ map <Leader>ct :!ctags -R .<CR>
|
||||||
" Cucumber navigation commands
|
" Cucumber navigation commands
|
||||||
autocmd User Rails Rnavcommand step features/step_definitions -glob=**/* -suffix=_steps.rb
|
autocmd User Rails Rnavcommand step features/step_definitions -glob=**/* -suffix=_steps.rb
|
||||||
autocmd User Rails Rnavcommand config config -glob=**/* -suffix=.rb -default=routes
|
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
|
" Switch between the last two files
|
||||||
nnoremap <leader><leader> <c-^>
|
nnoremap <leader><leader> <c-^>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#compdef ack
|
#compdef ag
|
||||||
|
|
||||||
if (( CURRENT == 2 )); then
|
if (( CURRENT == 2 )); then
|
||||||
if [[ -a tmp/tags ]]; then
|
if [[ -a tmp/tags ]]; then
|
Loading…
Add table
Reference in a new issue