Skip to content

Instantly share code, notes, and snippets.

@brianegge
Created December 31, 2011 20:17
Show Gist options
  • Save brianegge/1545221 to your computer and use it in GitHub Desktop.
Save brianegge/1545221 to your computer and use it in GitHub Desktop.
.bash_common
export GREP_OPTIONS=--color=auto
ffind ()
{
find . -name ".svn" -prune -o -name "CVS" -prune -o -name ".hg" -prune -o -exec grep --color=auto "$@" {} +
}
@hughdbrown
Copy link

I'm guessing that this greps files but omits searching in version control directories. Why not check out ack-grep?

sudo apt-get install ack-grep

@brianegge
Copy link
Author

Thanks for the tip Hugh! I just installed ack-grep on my Mac. I'm not allowed to download stuff off the internet at work, so I'll have to see if they have this perl module available, or if they can get it setup.

Looks like a very nice tool for code searching. We have OpenGrok servers setup at work, but I find most the time I'd rather just grep the files I have checked out for whatever I'm looking for.

@hughdbrown
Copy link

Here is my .ackrc file:

--type-set=fm=.ftl
--type-set=mako=.mako
--type-set=spec=.spec
--type-set=scss=.scss
--type-set=coffee=.coffee
--type-add=python=.mako
--type-set=ini=.ini
--type-set=ejs=.ejs
--type-set=txt=.txt
--type-set=css=.css

--type-set=fm=.ftl
--type-set=mako=.mako
--type-set=spec=.spec
--type-set=scss=.scss
--type-set=coffee=.coffee
--type-add=python=.mako
--type-set=ini=.ini
--type-set=ejs=.ejs
--type-set=txt=.txt
--type-set=css=.css

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment