This commit is contained in:
Vahagn Khachatryan
2017-02-21 09:13:59 -05:00
parent 4aeb996064
commit ee0d592419

View File

@@ -259,7 +259,28 @@ else
alias fgrep='fgrep --color=auto' alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto' alias egrep='egrep --color=auto'
fi fi
alias cgrep="grep --include \*.cpp --include \*.h --include \*.c"
function cgrep() {
if [[ $# -eq 0 ]]
then
echo "Usage: codegrep <pattern> "
else
grep -nR --colour \
--include=\*.cpp \
--include=\*.c \
--include=\*.hpp \
--include=\*.h \
--include=\*.inc \
--include=\*.php \
--include=\*.py \
--include=\*.sh \
--exclude-dir=.git \
--exclude-dir=.svn \
--exclude-dir=llcalc* \
--exclude-dir=00* \
"$1" .
fi
}
# Add an "alert" alias for long running commands. Use like so: # Add an "alert" alias for long running commands. Use like so: