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
![Less and grep](/assets/notes/grep-less.png)
Other notes
- Cache busting in Hugo
- Sane defaults for tmux with more visible statusbar
- dcss Sane default for Dungeon Crawl Stone Soup Online edition
- Fix screen tearing on Debian 12 Xorg and i3
- #cat-v on weechat configuration
- vim Personal sane Vim defaults
- Uninstall Ollama from a Linux box
- 60's IBM Computers Commercial
- Push to multiple origins at once in Git
- c Extend Lua with custom C functions using Clang
- Alacritty open links with modifier
- plan9 Compile drawterm on Fedora 38
- Making cgit look nicer
- Development environments with Nix
- Convert all MKV files into other formats