Parcourir la source

Merge branch 'master' of github.com:10sr/dotfiles

pull/1/head
10sr il y a 11 ans
Parent
révision
5bb3e801a2
1 fichiers modifiés avec 12 ajouts et 6 suppressions
  1. +12
    -6
      bashrc

+ 12
- 6
bashrc Voir le fichier

@@ -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
@@ -353,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


Chargement…
Annuler
Enregistrer