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
Drawing Pixels in Plan9plan9
Install Plan9port on Linuxplan9
Add lazy loading of images in Jekyll posts
AWS EB PyYAML fix
Development environments with Nix
Edsger W. Dijkstra Manuscripts ebook
Aerial photography of algae spotted on river Sava
Bulk thumbnails
Simple presentations with Markdown
Dungeon Crawl Stone Soup - New player guidedcss
Easy measure time took in a bash script
Set color temperature of displays on i3
Use option key as meta in Alacritty under macOS
10/GUI 10 Finger Multitouch User Interface
Push to multiple origins at once in Git