Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsApr 11, 2026·2 min de lectura

bat — A cat Clone with Wings and Syntax Highlighting

bat is a cat clone with wings — syntax highlighting, Git integration, automatic paging, and line numbers. A drop-in replacement for cat that shows code and configs beautifully in your terminal. Written in Rust.

Introducción

bat is a cat(1) clone with wings. Instead of dumping file contents like cat, bat shows them with syntax highlighting, Git modifications indicator, automatic paging, and line numbers. Written in Rust by David Peter (sharkdp). A huge quality-of-life upgrade for anyone who lives in the terminal.

What bat Does

  • Syntax highlighting — 200+ languages via syntect
  • Git integration — show modified/added lines
  • Automatic paging — pipe into less for long files
  • Line numbers — optional
  • File concatenation — works like cat when piped
  • Themes — 20+ built-in, Sublime Text theme compatible
  • fzf integration — beautiful previews
  • man pager — render man pages with syntax

Architecture

Rust binary using syntect for syntax highlighting (parses Sublime .sublime-syntax files) and less for paging. Detects terminal capabilities (256 colors, truecolor, piped vs tty).

Self-Hosting

CLI tool, self-contained binary.

Key Features

  • 200+ languages
  • Git diff indicators
  • Auto pager (less)
  • Customizable themes
  • Works as drop-in cat replacement
  • Can serve as man pager
  • fzf preview integration
  • Ligature-friendly output

Comparison

Tool Highlight Git Themes
bat 200+ Yes 20+
cat No No No
ccat 25 No Few
pygmentize 300+ No Via CLI
rich (Python) 100+ No Via lib

FAQ

Q: Is it called batcat on Ubuntu? A: Yes. Debian renamed it batcat due to a naming conflict. You can alias bat=batcat or mkdir -p ~/.local/bin && ln -s /usr/bin/batcat ~/.local/bin/bat.

Q: How do I set it as the default manpager? A: Set the MANPAGER environment variable to sh -c "col -bx | bat -l man -p" — man pages will look much nicer.

Q: Custom syntax and themes? A: Drop .sublime-syntax / .tmTheme files into the corresponding subdirectory of bat --config-dir, then run bat cache --build.

Sources & Credits

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados