Grep to Less that maintain colors

note, May 29, 2023 on Mitja Felicijan's blog

I often use grep to search for todo's in my code and other people's code and @@ -7,21 +7,18 @@ then pipe them in less and I missed having colors that grep outputs create todo function in your .bashrc that accepts first argument as search string.

# This is where the magic happens.
 grep --color=always -rni "TODO:" | less -R
-
Less and grep