The Silver Searcher is very good for using the terminal as an IDE.
I have two aliases which I find very helpful.
- Search Obj-C files:
alias ago='ag -G ".*\.(h|m)"'
- Search Ruby files: alias agr='ag -G ".*.rb"'
Also if you are looking for an alternative to sed don't miss replace[1].