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
- Using ffmpeg to combine videos side by side
- Extending dte editor
- Make B/W SVG charts with matplotlib
- dcss Dungeon Crawl Stone Soup - New player guide
- Convert all MKV files into other formats
- Bulk thumbnails
- Online radio streaming with MPV from terminal
- Aerial photography of algae spotted on river Sava
- Use option key as meta in Alacritty under macOS
- Add lazy loading of images in Jekyll posts
- Extract lines from a file with sed
- dcss Make DCSS playable on 4k displays
- Push to multiple origins at once in Git
- Edsger W. Dijkstra Manuscripts ebook
- Previews how man page written in Troff will look like