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
Extract lines from a file with sed
Using ffmpeg to combine videos side by side
Use option key as meta in Alacritty under macOS
Take a screenshot in Plan9plan9
Extend Lua with custom C functions using Clangc
Mount Plan9 over networkplan9
Currated list of Vim ALE linters
Dungeon Crawl Stone Soup - New player guidedcss
Calling assembly functions from Cc
Simple presentations with Markdown
Alacritty open links with modifier
Compile drawterm on Fedora 38plan9
Sending signals to C programsc
Display xterm color palette
Online radio streaming with MPV from terminal