Replace g+ with ag+
This commit is contained in:
parent
7046de9503
commit
7eb22341f2
3 changed files with 13 additions and 22 deletions
|
|
@ -82,9 +82,9 @@ I spawn Acme by running `a` script.
|
||||||
Who is who in **bin** directory:
|
Who is who in **bin** directory:
|
||||||
|
|
||||||
- `a` start Acme
|
- `a` start Acme
|
||||||
|
- `ag+` search with The Silver Searcher
|
||||||
- `c+ SYMBOL` comment selection (python: `|c+` or `|c+ '#'`, erlang: `|c+ %`, js: `|c+ //`)
|
- `c+ SYMBOL` comment selection (python: `|c+` or `|c+ '#'`, erlang: `|c+ %`, js: `|c+ //`)
|
||||||
- `c- SYMBOL` uncomment selection
|
- `c- SYMBOL` uncomment selection
|
||||||
- `g+ WHAT` recursively grep current directory
|
|
||||||
- `git+ MESSAGE` git: commit and push to master
|
- `git+ MESSAGE` git: commit and push to master
|
||||||
- `h+` heading
|
- `h+` heading
|
||||||
- `hg+ MESSAGE` hg: commit and push to master
|
- `hg+ MESSAGE` hg: commit and push to master
|
||||||
|
|
|
||||||
12
bin/ag+
Executable file
12
bin/ag+
Executable file
|
|
@ -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 "$@"
|
||||||
21
bin/g+
21
bin/g+
|
|
@ -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;
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue