3[](https://travis-ci.org/sharkdp/bat)
4[](https://crates.io/crates/bat)
6A *cat(1)* clone with syntax highlighting and Git integration.
10### Syntax highlighting
12`bat` supports syntax highlighting for a large number of programming and markup
15
19`bat` communicates with `git` to show modifications with respect to the index
22
26`bat` can pipe its own output to `less` if the output is too large for one screen.
30Oh.. you can also use it to concatenate files :wink:. Whenever
31`bat` detects a non-interactive terminal, it will fall back to printing
32the plain file contents.
36Display a single file on the terminal
42Display multiple files at once
48Explicitly specify the language
51> yaml2json .travis.yml | json_pp | bat -l json
55> curl -s https://raw.githubusercontent.com/sharkdp/bat/master/src/main.rs | bat -l rs
63Check out the [Release page](https://github.com/sharkdp/bat/releases) for
64binary builds and Debian packages.
68You can install [the AUR package](https://aur.archlinux.org/packages/bat/)
69via yaourt, or manually:
72git clone https://aur.archlinux.org/bat.git
79You can install `bat` with [Homebrew](http://braumeister.org/formula/bat):
87If you want to build to compile `bat` from source, you need Rust 1.24 or
88higher. You can then use `cargo` to build everything:
94On macOS, you might have to install `cmake` (`brew install cmake`) in order for
95some dependencies to be built.
99`bat` uses the excellent [`syntect`](https://github.com/trishume/syntect/)
100library for syntax highlighting. `syntect` can read any
101[Sublime Text `.sublime-syntax` file](https://www.sublimetext.com/docs/3/syntax.html)
104To build your own language-set and theme, follow these steps:
106Create a folder with a syntax highlighting theme:
109BAT_CONFIG_DIR="$(bat cache --config-dir)"
111mkdir -p "$BAT_CONFIG_DIR/themes"
112cd "$BAT_CONFIG_DIR/themes"
114# Download a theme, for example:
115git clone https://github.com/jonschlinkert/sublime-monokai-extended
117# Create a 'Default.tmTheme' link
118ln -s "sublime-monokai-extended/Monokai Extended.tmTheme" Default.tmTheme
121Create a folder with language definition files:
124mkdir -p "$BAT_CONFIG_DIR/syntax"
125cd "$BAT_CONFIG_DIR/syntax"
127# Download some language definition files, for example:
128git clone https://github.com/sublimehq/Packages/
129rm -rf Packages/Markdown
130git clone https://github.com/jonschlinkert/sublime-markdown-extended
133Finally, use the following command to parse all these files into a binary
140If you ever want to go back to the default settings, call:
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list