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 less
.
- Grep's
--color=always
use markers to highlight the matching strings. - Less's
-R
option 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
string.
# This is where the magic happens.
grep --color=always -rni "TODO:" | less -R
Other notes
- Use option key as meta in Alacritty under macOS
- Execute not blocking async shell command in C#
- c Sending signals to C programs
- Set color temperature of displays on i3
- Simple presentations with Markdown
- Aerial photography of algae spotted on river Sava
- Download list of YouTube files
- c Extend Lua with custom C functions using Clang
- Sane defaults for tmux with more visible statusbar
- Uninstall Ollama from a Linux box
- #cat-v on weechat configuration
- Convert all MKV files into other formats
- 10/GUI 10 Finger Multitouch User Interface
- dcss Make DCSS playable on 4k displays
- AWS EB PyYAML fix