27 lines
899 B
Markdown
27 lines
899 B
Markdown
---
|
|
title: "bat"
|
|
category: "Terminal and shell"
|
|
tagline: "cat with syntax highlighting, line numbers and Git changes."
|
|
source: "pacman"
|
|
package: "bat"
|
|
command: "bat"
|
|
code: "https://github.com/sharkdp/bat"
|
|
---
|
|
|
|
## 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.
|