What it is
bat prints files to the terminal like cat, but with syntax highlighting for most languages, line numbers, and markers for lines changed since the last Git commit. Long files open in a pager so you can scroll.
bat script.sh
Why it’s here
- Readable code in the terminal. Highlighting makes config files and scripts easier to scan.
- Good previews. Other tools use it to show file contents, such as fzf’s preview pane.
On CoreDesktop
bat is installed from pacman. Type bat in a terminal. CoreDesktop’s ff alias uses it to preview files while you fuzzy-find them with fzf. update keeps bat current along with the rest of the pacman packages.