cat clone with wings

As a terminal user, I’m pretty sure I use cat command daily.

Today I learned about bat, a cat clone with syntax highlighting and Git integration.

bat logo

Usage

Just add bat before the file/s you want to print

syntax highlighting example

Git integration

git integration example

bat supports automatic paging, so if your file is too large for the screen it will automatically pipe the output to less.

It can read from stdin and automatically determine the syntax, though you can always specify it explicitly with the -l option.

Installation

on macOS with Homebrew

$ brew install bat

Pro Tips

  1. You can choose your favorite theme, out of the available options (bat --list-themes), using --theme= flag.

    bat DarkNeon theme

    For more advanced configuration, search for the --style option and its possible values.

  2. Add -A / --show-all flag to highlight non-printable characters

comments powered by Disqus