diff --git a/README.md b/README.md index 8df859e..af0b093 100644 --- a/README.md +++ b/README.md @@ -82,9 +82,9 @@ I spawn Acme by running `a` script. Who is who in **bin** directory: - `a` start Acme +- `ag+` search with The Silver Searcher - `c+ SYMBOL` comment selection (python: `|c+` or `|c+ '#'`, erlang: `|c+ %`, js: `|c+ //`) - `c- SYMBOL` uncomment selection -- `g+ WHAT` recursively grep current directory - `git+ MESSAGE` git: commit and push to master - `h+` heading - `hg+ MESSAGE` hg: commit and push to master diff --git a/bin/ag+ b/bin/ag+ new file mode 100755 index 0000000..7c8a25a --- /dev/null +++ b/bin/ag+ @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +if [ ! "$(which ag)" ]; then + echo '+----------------------------------------------------+' + echo '| The Silver Searcher is not found. Go get it tiger! |' + echo '| |' + echo '| https://github.com/ggreer/the_silver_searcher |' + echo '+----------------------------------------------------+' + exit 1 +fi + +ag --nocolor --noheading "$@" diff --git a/bin/g+ b/bin/g+ deleted file mode 100755 index 5be5fdb..0000000 --- a/bin/g+ +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env perl - -## VERY NICE: USE `g+` IN COMBO WITH MOUSE CHORD -## ----------------------------------------------------------------------------- - -## To search for literal text in the current directory: -## 1. point at text with button 1 in any window -## 2. release button 1 -## 3. execute `g+`, clicking button 1 while 2 is held down - -use strict; -use warnings; -use Cwd; - -die "don't know what to grep" unless @ARGV; - -my $what = join ' ', @ARGV; -my $cwd = getcwd(); -my $result = `grep -nR '$what' $cwd`; - -print $result;