DEV Community

Bartłomiej Stefański
Bartłomiej Stefański

Posted on • Originally published at bstefanski.com on

🕹️ How to prettify your cat command

I have always used the cat command to quickly preview some files or to copy the contents of them to a clipboard. The second part was always working great, but previewing a let's say JavaScript file or RC file was painful, because of the lack of syntax highlighting.

I was too lazy to search for solutions, but my colleague recently showed me something called bat, which is a cat, but on steroids. Here's a little preview of what it looks like:

Preview of bat command

Installation and theme setup

You can install it through brew, just like this:

$ brew install bat

and if you don't like the default theme, you can choose some that are installed out of the box or install the custom one. I decided to use Nord, which was already installed, here's how I did it:

$ mkdir ~/.config/bat $ sudo vim ~/.config/bat/config # remember to run it in sudo mode

then paste this line into the config

--theme="Nord"

and exit vim with :wq and you're done!

P.S you can still copy the contents of the file with bat something.txt | pbcopy! 🤠

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay