diff --git a/config/.bashrc b/config/.bashrc index 401792c..8106d64 100755 --- a/config/.bashrc +++ b/config/.bashrc @@ -259,7 +259,28 @@ else alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi -alias cgrep="grep --include \*.cpp --include \*.h --include \*.c" + +function cgrep() { + if [[ $# -eq 0 ]] + then + echo "Usage: codegrep " + 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: