Grep to Less that maintain colors
I often use
grep to search for todo's in my code and other people's code and
then pipe them in
less and I missed having colors that grep outputs in
--color=alwaysuse markers to highlight the matching strings.
-Roption outputs "raw" control characters.
You could use
alias grep='grep --color=always' and
alias less='less -R' or
create todo function in your
.bashrc that accepts first argument as search
# This is where the magic happens. grep --color=always -rni "TODO:" | less -R