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 then pipe them in less and I missed having colors that grep outputs in less.

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 string.

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

Other notes

DateTitle
Online radio streaming with MPV from terminal
Embedding resources into binary with Cc
60's IBM Computers Commercial
Calling assembly functions from Cc
Display xterm color palette
#cat-v on weechat configuration
Make B/W SVG charts with matplotlib
Male and female body proportion reference images3d
Lua performance in different environments
Alacritty open links with modifier
Grep to Less that maintain colors
10/GUI 10 Finger Multitouch User Interface
Making cgit look nicer
Write ISO to USB Key
Cache busting in Hugo