From 5bcbb3b312b73b11b9cb2f88b9760526ce0365a2 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 2 Jul 2013 16:16:43 +0900 Subject: [PATCH 1/2] bashrc: add rsync alias rs --- bashrc | 1 + 1 file changed, 1 insertion(+) diff --git a/bashrc b/bashrc index 91f6d6a..1337934 100755 --- a/bashrc +++ b/bashrc @@ -238,6 +238,7 @@ null type htags && alias htags="htags --xhtml --symbol --line-number \ --frame --alphabet --verbose" null type aunpack && alias au=aunpack null type lv && alias lv="lv|less" +null type rsync && alias rs="rsync --progress --itemize-changes --compress" isdarwin && alias updatedb="LC_ALL=C updatedb" # do not use locate installed by macports From 187dd26a14a8b519da962b493356e7f579939bfc Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 2 Jul 2013 16:21:37 +0900 Subject: [PATCH 2/2] bashrc: update s function --- bashrc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/bashrc b/bashrc index 1337934..4119cae 100755 --- a/bashrc +++ b/bashrc @@ -354,23 +354,28 @@ clk(){ } s(){ - if test $# -eq 0 - then - echo "No search word given." 1>&2 - return 1 - fi + # if test $# -eq 0 + # then + # echo "No search word given." 1>&2 + # return 1 + # fi if git rev-parse --git-dir >/dev/null 2>&1 then + echo ">> Using git-grep" 1>&2 git grep -n "$@" elif which ag >/dev/null 2>&1 then + echo ">> Using ag" 1>&2 ag --pager="$PAGER" "$@" elif which ack >/dev/null 2>&1 then + echo ">> Using ack" 1>&2 ack --pager="$PAGER" "$@" else - grep -nH --exclude='.svn/*' --exclude='.git/*' "$@" -r . | $PAGER + echo ">> Using grep" 1>&2 + grep -nH --color=always --exclude='.svn/*' --exclude='.git/*' "$@" -r . \ + | $PAGER # echo "No search command found. Use grep." 2>&1 # return 127 fi