{"id":13393909,"url":"https://github.com/sharkdp/bat","last_synced_at":"2025-05-12T17:43:39.619Z","repository":{"id":37261168,"uuid":"130464961","full_name":"sharkdp/bat","owner":"sharkdp","description":"A cat(1) clone with wings.","archived":false,"fork":false,"pushed_at":"2025-05-05T06:46:01.000Z","size":32989,"stargazers_count":52415,"open_issues_count":364,"forks_count":1289,"subscribers_count":208,"default_branch":"master","last_synced_at":"2025-05-05T15:09:52.602Z","etag":null,"topics":["cli","command-line","git","hacktoberfest","rust","syntax-highlighting","terminal","tool"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sharkdp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"sharkdp"}},"created_at":"2018-04-21T10:52:23.000Z","updated_at":"2025-05-05T14:14:48.000Z","dependencies_parsed_at":"2022-07-13T19:30:34.570Z","dependency_job_id":"f4f63f84-176c-4290-a7b1-4dd1b8186665","html_url":"https://github.com/sharkdp/bat","commit_stats":{"total_commits":2604,"total_committers":358,"mean_commits":7.273743016759776,"dds":0.7227342549923195,"last_synced_commit":"3d87b25b190e0990e0e75a2ab8f994d6c277d263"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharkdp%2Fbat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharkdp%2Fbat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharkdp%2Fbat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharkdp%2Fbat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sharkdp","download_url":"https://codeload.github.com/sharkdp/bat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253789597,"owners_count":21964702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","git","hacktoberfest","rust","syntax-highlighting","terminal","tool"],"created_at":"2024-07-30T17:01:02.361Z","updated_at":"2025-05-12T17:43:38.675Z","avatar_url":"https://github.com/sharkdp.png","language":"Rust","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"doc/logo-header.svg\" alt=\"bat - a cat clone with wings\"\u003e\u003cbr\u003e\n  \u003ca href=\"https://github.com/sharkdp/bat/actions?query=workflow%3ACICD\"\u003e\u003cimg src=\"https://github.com/sharkdp/bat/workflows/CICD/badge.svg\" alt=\"Build Status\"\u003e\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/crates/l/bat.svg\" alt=\"license\"\u003e\n  \u003ca href=\"https://crates.io/crates/bat\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/bat.svg?colorB=319e8c\" alt=\"Version info\"\u003e\u003c/a\u003e\u003cbr\u003e\n  A \u003ci\u003ecat(1)\u003c/i\u003e clone with syntax highlighting and Git integration.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#syntax-highlighting\"\u003eKey Features\u003c/a\u003e •\n  \u003ca href=\"#how-to-use\"\u003eHow To Use\u003c/a\u003e •\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"#customization\"\u003eCustomization\u003c/a\u003e •\n  \u003ca href=\"#project-goals-and-alternatives\"\u003eProject goals, alternatives\u003c/a\u003e\u003cbr\u003e\n  [English]\n  [\u003ca href=\"doc/README-zh.md\"\u003e中文\u003c/a\u003e]\n  [\u003ca href=\"doc/README-ja.md\"\u003e日本語\u003c/a\u003e]\n  [\u003ca href=\"doc/README-ko.md\"\u003e한국어\u003c/a\u003e]\n  [\u003ca href=\"doc/README-ru.md\"\u003eРусский\u003c/a\u003e]\n\u003c/p\u003e\n\n### Sponsors\n\nA special *thank you* goes to our biggest \u003ca href=\"doc/sponsors.md\"\u003esponsors\u003c/a\u003e:\u003cbr\u003e\n\n\u003cp\u003e\n\u003ca href=\"https://www.warp.dev/bat\"\u003e\n  \u003cimg src=\"doc/sponsors/warp-logo.png\" width=\"200\" alt=\"Warp\"\u003e\n  \u003cbr\u003e\n  \u003cstrong\u003eWarp, the intelligent terminal\u003c/strong\u003e\n  \u003cbr\u003e\n  \u003csub\u003eAvailable on MacOS, Linux, Windows\u003c/sub\u003e\n\u003c/a\u003e\n\u003c/p\u003e\u003cp\u003e\n\u003ca href=\"https://graphite.dev/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=bat\"\u003e\n  \u003cimg src=\"doc/sponsors/graphite-logo.jpeg\" width=\"200\" alt=\"Graphite\"\u003e\n  \u003cbr\u003e\n  \u003cstrong\u003eGraphite is the AI developer productivity platform helping\u003cbr\u003eteams on GitHub ship higher quality software, faster\u003c/strong\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n### Syntax highlighting\n\n`bat` supports syntax highlighting for a large number of programming and markup\nlanguages:\n\n![Syntax highlighting example](https://imgur.com/rGsdnDe.png)\n\n### Git integration\n\n`bat` communicates with `git` to show modifications with respect to the index\n(see left side bar):\n\n![Git integration example](https://i.imgur.com/2lSW4RE.png)\n\n### Show non-printable characters\n\nYou can use the `-A`/`--show-all` option to show and highlight non-printable\ncharacters:\n\n![Non-printable character example](https://i.imgur.com/WndGp9H.png)\n\n### Automatic paging\n\nBy default, `bat` pipes its own output to a pager (e.g. `less`) if the output is too large for one screen.\nIf you would rather `bat` work like `cat` all the time (never page output), you can set `--paging=never` as an option, either on the command line or in your configuration file.\nIf you intend to alias `cat` to `bat` in your shell configuration, you can use `alias cat='bat --paging=never'` to preserve the default behavior.\n\n#### File concatenation\n\nEven with a pager set, you can still use `bat` to concatenate files :wink:.\nWhenever `bat` detects a non-interactive terminal (i.e. when you pipe into another process or into a file), `bat` will act as a drop-in replacement for `cat` and fall back to printing the plain file contents, regardless of the `--pager` option's value.\n\n## How to use\n\nDisplay a single file on the terminal\n\n```bash\n\u003e bat README.md\n```\n\nDisplay multiple files at once\n\n```bash\n\u003e bat src/*.rs\n```\n\nRead from stdin, determine the syntax automatically (note, highlighting will\nonly work if the syntax can be determined from the first line of the file,\nusually through a shebang such as `#!/bin/sh`)\n\n```bash\n\u003e curl -s https://sh.rustup.rs | bat\n```\n\nRead from stdin, specify the language explicitly\n\n```bash\n\u003e yaml2json .travis.yml | json_pp | bat -l json\n```\n\nShow and highlight non-printable characters:\n```bash\n\u003e bat -A /etc/hosts\n```\n\nUse it as a `cat` replacement:\n\n```bash\nbat \u003e note.md  # quickly create a new file\n\nbat header.md content.md footer.md \u003e document.md\n\nbat -n main.rs  # show line numbers (only)\n\nbat f - g  # output 'f', then stdin, then 'g'.\n```\n\n### Integration with other tools\n\n#### `fzf`\n\nYou can use `bat` as a previewer for [`fzf`](https://github.com/junegunn/fzf). To do this,\nuse `bat`s `--color=always` option to force colorized output. You can also use `--line-range`\noption to restrict the load times for long files:\n\n```bash\nfzf --preview \"bat --color=always --style=numbers --line-range=:500 {}\"\n```\n\nFor more information, see [`fzf`'s `README`](https://github.com/junegunn/fzf#preview-window).\n\n#### `find` or `fd`\n\nYou can use the `-exec` option of `find` to preview all search results with `bat`:\n\n```bash\nfind … -exec bat {} +\n```\n\nIf you happen to use [`fd`](https://github.com/sharkdp/fd), you can use the `-X`/`--exec-batch` option to do the same:\n\n```bash\nfd … -X bat\n```\n\n#### `ripgrep`\n\nWith [`batgrep`](https://github.com/eth-p/bat-extras/blob/master/doc/batgrep.md), `bat` can be used as the printer for [`ripgrep`](https://github.com/BurntSushi/ripgrep) search results.\n\n```bash\nbatgrep needle src/\n```\n\n#### `tail -f`\n\n`bat` can be combined with `tail -f` to continuously monitor a given file with syntax highlighting.\n\n```bash\ntail -f /var/log/pacman.log | bat --paging=never -l log\n```\n\nNote that we have to switch off paging in order for this to work. We have also specified the syntax\nexplicitly (`-l log`), as it can not be auto-detected in this case.\n\n#### `git`\n\nYou can combine `bat` with `git show` to view an older version of a given file with proper syntax\nhighlighting:\n\n```bash\ngit show v0.6.0:src/main.rs | bat -l rs\n```\n\n#### `git diff`\n\nYou can combine `bat` with `git diff` to view lines around code changes with proper syntax\nhighlighting:\n```bash\nbatdiff() {\n    git diff --name-only --relative --diff-filter=d | xargs bat --diff\n}\n```\nIf you prefer to use this as a separate tool, check out `batdiff` in [`bat-extras`](https://github.com/eth-p/bat-extras).\n\nIf you are looking for more support for git and diff operations, check out [`delta`](https://github.com/dandavison/delta).\n\n#### `xclip`\n\nThe line numbers and Git modification markers in the output of `bat` can make it hard to copy\nthe contents of a file. To prevent this, you can call `bat` with the `-p`/`--plain` option or\nsimply pipe the output into `xclip`:\n```bash\nbat main.cpp | xclip\n```\n`bat` will detect that the output is being redirected and print the plain file contents.\n\n#### `man`\n\n`bat` can be used as a colorizing pager for `man`, by setting the\n`MANPAGER` environment variable:\n\n```bash\nexport MANPAGER=\"sh -c 'sed -u -e \\\"s/\\\\x1B\\[[0-9;]*m//g; s/.\\\\x08//g\\\" | bat -p -lman'\"\nman 2 select\n```\n(replace `bat` with `batcat` if you are on Debian or Ubuntu)\n\nIf you prefer to have this bundled in a new command, you can also use [`batman`](https://github.com/eth-p/bat-extras/blob/master/doc/batman.md).\n\n\u003e [!WARNING]  \n\u003e This will [not work](https://github.com/sharkdp/bat/issues/1145) out of the box with Mandoc's `man` implementation.\n\u003e\n\u003e Please either use `batman`, or convert the shell script to a [shebang executable](https://en.wikipedia.org/wiki/Shebang_(Unix)) and point `MANPAGER` to that.\n\nNote that the [Manpage syntax](assets/syntaxes/02_Extra/Manpage.sublime-syntax) is developed in this repository and still needs some work.\n\n#### `prettier` / `shfmt` / `rustfmt`\n\nThe [`prettybat`](https://github.com/eth-p/bat-extras/blob/master/doc/prettybat.md) script is a wrapper that will format code and print it with `bat`.\n\n#### `Warp`\n\n\u003ca href=\"https://app.warp.dev/drive/folder/-Bat-Warp-Pack-lxhe7HrEwgwpG17mvrFSz1\"\u003e\n  \u003cimg src=\"doc/sponsors/warp-pack-header.png\" alt=\"Warp\"\u003e\n\u003c/a\u003e\n\n#### Highlighting `--help` messages\n\nYou can use `bat` to colorize help text: `$ cp --help | bat -plhelp`\n\nYou can also use a wrapper around this:\n\n```bash\n# in your .bashrc/.zshrc/*rc\nalias bathelp='bat --plain --language=help'\nhelp() {\n    \"$@\" --help 2\u003e\u00261 | bathelp\n}\n```\n\nThen you can do `$ help cp` or `$ help git commit`.\n\nWhen you are using `zsh`, you can also use global aliases to override `-h` and `--help` entirely:\n\n```bash\nalias -g -- -h='-h 2\u003e\u00261 | bat --language=help --style=plain'\nalias -g -- --help='--help 2\u003e\u00261 | bat --language=help --style=plain'\n```\n\nFor `fish`, you can use abbreviations:\n\n```fish\nabbr -a --position anywhere -- --help '--help | bat -plhelp'\nabbr -a --position anywhere -- -h '-h | bat -plhelp'\n```\n\nThis way, you can keep on using `cp --help`, but get colorized help pages.\n\nBe aware that in some cases, `-h` may not be a shorthand of `--help` (for example with `ls`).\n\nPlease report any issues with the help syntax in [this repository](https://github.com/victor-gp/cmd-help-sublime-syntax).\n\n\n## Installation\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/bat-cat.svg?columns=3\u0026exclude_unsupported=1)](https://repology.org/project/bat-cat/versions)\n\n### On Ubuntu (using `apt`)\n*... and other Debian-based Linux distributions.*\n\n`bat` is available on [Ubuntu since 20.04 (\"Focal\")](https://packages.ubuntu.com/search?keywords=bat\u0026exact=1) and [Debian since August 2021 (Debian 11 - \"Bullseye\")](https://packages.debian.org/bullseye/bat).\n\nIf your Ubuntu/Debian installation is new enough you can simply run:\n\n```bash\nsudo apt install bat\n```\n\n**Important**: If you install `bat` this way, please note that the executable may be installed as `batcat` instead of `bat` (due to [a name\nclash with another package](https://github.com/sharkdp/bat/issues/982)). You can set up a `bat -\u003e batcat` symlink or alias to prevent any issues that may come up because of this and to be consistent with other distributions:\n``` bash\nmkdir -p ~/.local/bin\nln -s /usr/bin/batcat ~/.local/bin/bat\n```\n\n### On Ubuntu (using most recent `.deb` packages)\n*... and other Debian-based Linux distributions.*\n\nIf the package has not yet been promoted to your Ubuntu/Debian installation, or you want\nthe most recent release of `bat`, download the latest `.deb` package from the\n[release page](https://github.com/sharkdp/bat/releases) and install it via:\n\n```bash\nsudo dpkg -i bat_0.18.3_amd64.deb  # adapt version number and architecture\n```\n\n### On Alpine Linux\n\nYou can install [the `bat` package](https://pkgs.alpinelinux.org/packages?name=bat)\nfrom the official sources, provided you have the appropriate repository enabled:\n\n```bash\napk add bat\n```\n\n### On Arch Linux\n\nYou can install [the `bat` package](https://www.archlinux.org/packages/extra/x86_64/bat/)\nfrom the official sources:\n\n```bash\npacman -S bat\n```\n\n### On Fedora\n\nYou can install [the `bat` package](https://koji.fedoraproject.org/koji/packageinfo?packageID=27506) from the official [Fedora Modular](https://docs.fedoraproject.org/en-US/modularity/using-modules/) repository.\n\n```bash\ndnf install bat\n```\n\n### On Funtoo Linux\n\nYou can install [the `bat` package](https://github.com/funtoo/dev-kit/tree/1.4-release/sys-apps/bat) from dev-kit.\n\n```bash\nemerge sys-apps/bat\n```\n\n### On Gentoo Linux\n\nYou can install [the `bat` package](https://packages.gentoo.org/packages/sys-apps/bat)\nfrom the official sources:\n\n```bash\nemerge sys-apps/bat\n```\n\n### On Void Linux\n\nYou can install `bat` via xbps-install:\n```bash\nxbps-install -S bat\n```\n\n### On Termux\n\nYou can install `bat` via pkg:\n```bash\npkg install bat\n```\n\n### On FreeBSD\n\nYou can install a precompiled [`bat` package](https://www.freshports.org/textproc/bat) with pkg:\n\n```bash\npkg install bat\n```\n\nor build it on your own from the FreeBSD ports:\n\n```bash\ncd /usr/ports/textproc/bat\nmake install\n```\n\n### On OpenBSD\n\nYou can install `bat` package using [`pkg_add(1)`](https://man.openbsd.org/pkg_add.1):\n\n```bash\npkg_add bat\n```\n\n### Via nix\n\nYou can install `bat` using the [nix package manager](https://nixos.org/nix):\n\n```bash\nnix-env -i bat\n```\n\n### Via flox\n\nYou can install `bat` using [Flox](https://flox.dev)\n\n```bash\nflox install bat\n```\n\n### On openSUSE\n\nYou can install `bat` with zypper:\n\n```bash\nzypper install bat\n```\n\n### Via snap package\n\nThere is currently no recommended snap package available.\nExisting packages may be available, but are not officially supported and may contain [issues](https://github.com/sharkdp/bat/issues/1519).\n\n### On macOS (or Linux) via Homebrew\n\nYou can install `bat` with [Homebrew](https://formulae.brew.sh/formula/bat):\n\n```bash\nbrew install bat\n```\n\n### On macOS via MacPorts\n\nOr install `bat` with [MacPorts](https://ports.macports.org/port/bat/summary):\n\n```bash\nport install bat\n```\n\n### On Windows\n\nThere are a few options to install `bat` on Windows. Once you have installed `bat`,\ntake a look at the [\"Using `bat` on Windows\"](#using-bat-on-windows) section.\n\n#### Prerequisites\n\nYou will need to install the [Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist#latest-microsoft-visual-c-redistributable-version)\n\n#### With WinGet\n\nYou can install `bat` via [WinGet](https://learn.microsoft.com/en-us/windows/package-manager/winget):\n\n```bash\nwinget install sharkdp.bat\n```\n\n#### With Chocolatey\n\nYou can install `bat` via [Chocolatey](https://chocolatey.org/packages/Bat):\n```bash\nchoco install bat\n```\n\n#### With Scoop\n\nYou can install `bat` via [scoop](https://scoop.sh/):\n```bash\nscoop install bat\n```\n\n#### From prebuilt binaries:\n\nYou can download prebuilt binaries from the [Release page](https://github.com/sharkdp/bat/releases),\n\nYou will need to install the [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) package.\n\n### From binaries\n\nCheck out the [Release page](https://github.com/sharkdp/bat/releases) for\nprebuilt versions of `bat` for many different architectures. Statically-linked\nbinaries are also available: look for archives with `musl` in the file name.\n\n### From source\n\nIf you want to build `bat` from source, you need Rust 1.74.0 or\nhigher. You can then use `cargo` to build everything:\n\n```bash\ncargo install --locked bat\n```\n\nNote that additional files like the man page or shell completion\nfiles can not be installed in this way. They will be generated by `cargo` and should be available in the cargo target folder (under `build`).\n\nShell completions are also available by running:\n```bash\nbat --completion \u003cshell\u003e\n# see --help for supported shells\n```\n\n## Customization\n\n### Highlighting theme\n\nUse `bat --list-themes` to get a list of all available themes for syntax\nhighlighting. To select the `TwoDark` theme, call `bat` with the\n`--theme=TwoDark` option or set the `BAT_THEME` environment variable to\n`TwoDark`. Use `export BAT_THEME=\"TwoDark\"` in your shell's startup file to\nmake the change permanent. Alternatively, use `bat`s\n[configuration file](https://github.com/sharkdp/bat#configuration-file).\n\nIf you want to preview the different themes on a custom file, you can use\nthe following command (you need [`fzf`](https://github.com/junegunn/fzf) for this):\n```bash\nbat --list-themes | fzf --preview=\"bat --theme={} --color=always /path/to/file\"\n```\n\n`bat` automatically picks a fitting theme depending on your terminal's background color.\nYou can use the `--theme-dark` / `--theme-light` options or the `BAT_THEME_DARK` / `BAT_THEME_LIGHT` environment variables\nto customize the themes used. This is especially useful if you frequently switch between dark and light mode.\n\nYou can also use a custom theme by following the\n['Adding new themes' section below](https://github.com/sharkdp/bat#adding-new-themes).\n\n### 8-bit themes\n\n`bat` has three themes that always use [8-bit colors](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors),\neven when truecolor support is available:\n\n- `ansi` looks decent on any terminal. It uses 3-bit colors: black, red, green,\n  yellow, blue, magenta, cyan, and white.\n- `base16` is designed for [base16](https://github.com/chriskempson/base16) terminal themes. It uses\n  4-bit colors (3-bit colors plus bright variants) in accordance with the\n  [base16 styling guidelines](https://github.com/chriskempson/base16/blob/master/styling.md).\n- `base16-256` is designed for [base16-shell](https://github.com/chriskempson/base16-shell).\n  It replaces certain bright colors with 8-bit colors from 16 to 21. **Do not** use this simply\n  because you have a 256-color terminal but are not using base16-shell.\n\nAlthough these themes are more restricted, they have three advantages over truecolor themes. They:\n\n- Enjoy maximum compatibility. Some terminal utilities do not support more than 3-bit colors.\n- Adapt to terminal theme changes. Even for already printed output.\n- Visually harmonize better with other terminal software.\n\n### Output style\n\nYou can use the `--style` option to control the appearance of `bat`s output.\nYou can use `--style=numbers,changes`, for example, to show only Git changes\nand line numbers but no grid and no file header. Set the `BAT_STYLE` environment\nvariable to make these changes permanent or use `bat`s\n[configuration file](https://github.com/sharkdp/bat#configuration-file).\n\n\u003e[!tip]\n\u003e If you specify a default style in `bat`'s config file, you can change which components\n\u003e are displayed during a single run of `bat` using the `--style` command-line argument.\n\u003e By prefixing a component with `+` or `-`, it can be added or removed from the current style.\n\u003e\n\u003e For example, if your config contains `--style=full,-snip`, you can run bat with\n\u003e `--style=-grid,+snip` to remove the grid and add back the `snip` component.\n\u003e Or, if you want to override the styles completely, you use `--style=numbers` to\n\u003e only show the line numbers.\n\n### Adding new syntaxes / language definitions\n\nShould you find that a particular syntax is not available within `bat`, you can follow these\ninstructions to easily add new syntaxes to your current `bat` installation.\n\n`bat` uses the excellent [`syntect`](https://github.com/trishume/syntect/)\nlibrary for syntax highlighting. `syntect` can read any\n[Sublime Text `.sublime-syntax` file](https://www.sublimetext.com/docs/3/syntax.html)\nand theme.\n\nA good resource for finding Sublime Syntax packages is [Package Control](https://packagecontrol.io/). Once you found a\nsyntax:\n\n1. Create a folder with syntax definition files:\n\n   ```bash\n   mkdir -p \"$(bat --config-dir)/syntaxes\"\n   cd \"$(bat --config-dir)/syntaxes\"\n\n   # Put new '.sublime-syntax' language definition files\n   # in this folder (or its subdirectories), for example:\n   git clone https://github.com/tellnobody1/sublime-purescript-syntax\n   ```\n\n2. Now use the following command to parse these files into a binary cache:\n\n   ```bash\n   bat cache --build\n   ```\n\n3. Finally, use `bat --list-languages` to check if the new languages are available.\n\n   If you ever want to go back to the default settings, call:\n\n   ```bash\n   bat cache --clear\n   ```\n\n4. If you think that a specific syntax should be included in `bat` by default, please\n   consider opening a \"syntax request\" ticket after reading the policies and\n   instructions [here](doc/assets.md): [Open Syntax Request](https://github.com/sharkdp/bat/issues/new?labels=syntax-request\u0026template=syntax_request.md).\n\n### Adding new themes\n\nThis works very similar to how we add new syntax definitions.\n\nFirst, create a folder with the new syntax highlighting themes:\n```bash\nmkdir -p \"$(bat --config-dir)/themes\"\ncd \"$(bat --config-dir)/themes\"\n\n# Download a theme in '.tmTheme' format, for example:\ngit clone https://github.com/greggb/sublime-snazzy\n\n# Update the binary cache\nbat cache --build\n```\n\nFinally, use `bat --list-themes` to check if the new themes are available.\n\n### Adding or changing file type associations\n\nYou can add new (or change existing) file name patterns using the `--map-syntax`\ncommand line option. The option takes an argument of the form `pattern:syntax` where\n`pattern` is a glob pattern that is matched against the file name and\nthe absolute file path. The `syntax` part is the full name of a supported language\n(use `bat --list-languages` for an overview).\n\n**Note:** You probably want to use this option as [an entry in `bat`'s configuration file](#configuration-file)\nfor persistence instead of passing it on the command line as a one-off. Generally\nyou'd just use `-l` if you want to manually specify a language for a file.\n\nExample: To use \"INI\" syntax highlighting for all files with a `.conf` file extension, use\n```bash\n--map-syntax='*.conf:INI'\n```\n\nExample: To open all files called `.ignore` (exact match) with the \"Git Ignore\" syntax, use:\n```bash\n--map-syntax='.ignore:Git Ignore'\n```\n\nExample: To open all `.conf` files in subfolders of `/etc/apache2` with the \"Apache Conf\"\nsyntax, use (this mapping is already built in):\n```bash\n--map-syntax='/etc/apache2/**/*.conf:Apache Conf'\n```\n\n### Using a different pager\n\n`bat` uses the pager that is specified in the `PAGER` environment variable. If this variable is not\nset, `less` is used by default. If you want to use a different pager, you can either modify the\n`PAGER` variable or set the `BAT_PAGER` environment variable to override what is specified in\n`PAGER`.\n\n\u003e[!NOTE]\n\u003e If `PAGER` is `more` or `most`, `bat` will silently use `less` instead to ensure support for colors.\n\nIf you want to pass command-line arguments to the pager, you can also set them via the\n`PAGER`/`BAT_PAGER` variables:\n\n```bash\nexport BAT_PAGER=\"less -RF\"\n```\n\nInstead of using environment variables, you can also use `bat`s [configuration file](https://github.com/sharkdp/bat#configuration-file) to configure the pager (`--pager` option).\n\n\n### Using `less` as a pager\n\nWhen using `less` as a pager, `bat` will automatically pass extra options along to `less`\nto improve the experience. Specifically, `-R`/`--RAW-CONTROL-CHARS`, `-F`/`--quit-if-one-screen`,\nand under certain conditions, `-X`/`--no-init` and/or `-S`/`--chop-long-lines`.\n\n\u003e[!IMPORTANT]\n\u003e These options will not be added if:\n\u003e - The pager is not named `less`.\n\u003e - The `--pager` argument contains any command-line arguments (e.g. `--pager=\"less -R\"`).\n\u003e - The `BAT_PAGER` environment variable contains any command-line arguments (e.g. `export BAT_PAGER=\"less -R\"`)\n\u003e\n\u003e The `--quit-if-one-screen` option will not be added when:\n\u003e - The `--paging=always` argument is used.\n\u003e - The `BAT_PAGING` environment is set to `always`.\n\nThe `-R` option is needed to interpret ANSI colors correctly.\n\nThe `-F` option instructs `less` to exit immediately if the output size is smaller than\nthe vertical size of the terminal. This is convenient for small files because you do not\nhave to press `q` to quit the pager.\n\nThe `-X` option is needed to fix a bug with the `--quit-if-one-screen` feature in versions\nof `less` older than version 530. Unfortunately, it also breaks mouse-wheel support in `less`.\nIf you want to enable mouse-wheel scrolling on older versions of `less` and do not mind losing\nthe quit-if-one-screen feature, you can set the pager (via `--pager` or `BAT_PAGER`) to `less -R`.\nFor `less` 530 or newer, it should work out of the box.\n\nThe `-S` option is added when `bat`'s `-S`/`--chop-long-lines` option is used. This tells `less`\nto truncate any lines larger than the terminal width.\n\n### Indentation\n\n`bat` expands tabs to 4 spaces by itself, not relying on the pager. To change this, simply add the\n`--tabs` argument with the number of spaces you want to be displayed.\n\n**Note**: Defining tab stops for the pager (via the `--pager` argument by `bat`, or via the `LESS`\nenvironment variable for `less`) won't be taken into account because the pager will already get\nexpanded spaces instead of tabs. This behaviour is added to avoid indentation issues caused by the\nsidebar. Calling `bat` with `--tabs=0` will override it and let tabs be consumed by the pager.\n\n### Dark mode\n\nIf you make use of the dark mode feature in macOS, you might want to configure `bat` to use a different\ntheme based on the OS theme. The following snippet uses the `default` theme when in the _dark mode_\nand the `GitHub` theme when in the _light mode_.\n\n```bash\nalias cat=\"bat --theme auto:system --theme-dark default --theme-light GitHub\"\n```\n\n\n## Configuration file\n\n`bat` can also be customized with a configuration file. The location of the file is dependent\non your operating system. To get the default path for your system, call\n```bash\nbat --config-file\n```\n\nAlternatively, you can use `BAT_CONFIG_PATH` or `BAT_CONFIG_DIR` environment variables to point `bat`\nto a non-default location of the configuration file or the configuration directory respectively:\n```bash\nexport BAT_CONFIG_PATH=\"/path/to/bat/bat.conf\"\nexport BAT_CONFIG_DIR=\"/path/to/bat\"\n```\n\nA default configuration file can be created with the `--generate-config-file` option.\n```bash\nbat --generate-config-file\n```\n\nThere is also now a systemwide configuration file, which is located under `/etc/bat/config` on\nLinux and Mac OS and `C:\\ProgramData\\bat\\config` on windows. If the system wide configuration\nfile is present, the content of the user configuration will simply be appended to it.\n\n### Format\n\nThe configuration file is a simple list of command line arguments. Use `bat --help` to see a full list of possible options and values. In addition, you can add comments by prepending a line with the `#` character.\n\nExample configuration file:\n```bash\n# Set the theme to \"TwoDark\"\n--theme=\"TwoDark\"\n\n# Show line numbers, Git modifications and file header (but no grid)\n--style=\"numbers,changes,header\"\n\n# Use italic text on the terminal (not supported on all terminals)\n--italic-text=always\n\n# Use C++ syntax for Arduino .ino files\n--map-syntax \"*.ino:C++\"\n```\n\n## Using `bat` on Windows\n\n`bat` mostly works out-of-the-box on Windows, but a few features may need extra configuration.\n\n### Prerequisites\n\nYou will need to install the [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) package.\n\n### Paging\n\nWindows only includes a very limited pager in the form of `more`. You can download a Windows binary\nfor `less` [from its homepage](http://www.greenwoodsoftware.com/less/download.html) or [through\nChocolatey](https://chocolatey.org/packages/Less). To use it, place the binary in a directory in\nyour `PATH` or [define an environment variable](#using-a-different-pager). The [Chocolatey package](#on-windows) installs `less` automatically.\n\n### Colors\n\nWindows 10 natively supports colors in both `conhost.exe` (Command Prompt) and PowerShell since\n[v1511](https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1511_(November_Update)), as\nwell as in newer versions of bash. On earlier versions of Windows, you can use\n[Cmder](http://cmder.app/), which includes [ConEmu](https://conemu.github.io/).\n\n**Note:** Old versions of `less` do not correctly interpret colors on Windows. To fix this, you can add the optional Unix tools to your PATH when installing Git. If you don’t have any other pagers installed, you can disable paging entirely by passing `--paging=never` or by setting `BAT_PAGER` to an empty string.\n\n### Cygwin\n\n`bat` on Windows does not natively support Cygwin's unix-style paths (`/cygdrive/*`). When passed an absolute cygwin path as an argument, `bat` will encounter the following error: `The system cannot find the path specified. (os error 3)`\n\nThis can be solved by creating a wrapper or adding the following function to your `.bash_profile` file:\n\n```bash\nbat() {\n    local index\n    local args=(\"$@\")\n    for index in $(seq 0 ${#args[@]}) ; do\n        case \"${args[index]}\" in\n        -*) continue;;\n        *)  [ -e \"${args[index]}\" ] \u0026\u0026 args[index]=\"$(cygpath --windows \"${args[index]}\")\";;\n        esac\n    done\n    command bat \"${args[@]}\"\n}\n```\n\n## Troubleshooting\n\n### Garbled output\n\nIf an input file contains color codes or other ANSI escape sequences or control characters, `bat` will have problems\nperforming syntax highlighting and text wrapping, and thus the output can become garbled.\n\nIf your version of `bat` supports the `--strip-ansi=auto` option, it can be used to remove such sequences\nbefore syntax highlighting. Alternatively, you may disable both syntax highlighting and wrapping by\npassing the `--color=never --wrap=never` options to `bat`.\n\n\u003e [!NOTE]\n\u003e The `auto` option of `--strip-ansi` avoids removing escape sequences when the syntax is plain text.\n\n### Terminals \u0026 colors\n\n`bat` handles terminals *with* and *without* truecolor support. However, the colors in most syntax\nhighlighting themes are not optimized for 8-bit colors. It is therefore strongly recommended\nthat you use a terminal with 24-bit truecolor support (`terminator`, `konsole`, `iTerm2`, ...),\nor use one of the basic [8-bit themes](#8-bit-themes) designed for a restricted set of colors.\nSee [this article](https://gist.github.com/XVilka/8346728) for more details and a full list of\nterminals with truecolor support.\n\nMake sure that your truecolor terminal sets the `COLORTERM` variable to either `truecolor` or\n`24bit`. Otherwise, `bat` will not be able to determine whether or not 24-bit escape sequences\nare supported (and fall back to 8-bit colors).\n\n### Line numbers and grid are hardly visible\n\nPlease try a different theme (see `bat --list-themes` for a list). The `OneHalfDark` and\n`OneHalfLight` themes provide grid and line colors that are brighter.\n\n### File encodings\n\n`bat` natively supports UTF-8 as well as UTF-16. For every other file encoding, you may need to\nconvert to UTF-8 first because the encodings can typically not be auto-detected. You can `iconv`\nto do so.\nExample: if you have a PHP file in Latin-1 (ISO-8859-1) encoding, you can call:\n``` bash\niconv -f ISO-8859-1 -t UTF-8 my-file.php | bat\n```\nNote: you might have to use the `-l`/`--language` option if the syntax can not be auto-detected\nby `bat`.\n\n## Development\n\n```bash\n# Recursive clone to retrieve all submodules\ngit clone --recursive https://github.com/sharkdp/bat\n\n# Build (debug version)\ncd bat\ncargo build --bins\n\n# Run unit tests and integration tests\ncargo test\n\n# Install (release version)\ncargo install --path . --locked\n\n# Build a bat binary with modified syntaxes and themes\nbash assets/create.sh\ncargo install --path . --locked --force\n```\n\nIf you want to build an application that uses `bat`s pretty-printing\nfeatures as a library, check out the [the API documentation](https://docs.rs/bat/).\nNote that you have to use either `regex-onig` or `regex-fancy` as a feature\nwhen you depend on `bat` as a library.\n\n## Contributing\n\nTake a look at the [`CONTRIBUTING.md`](CONTRIBUTING.md) guide.\n\n## Maintainers\n\n- [sharkdp](https://github.com/sharkdp)\n- [eth-p](https://github.com/eth-p)\n- [keith-hall](https://github.com/keith-hall)\n- [Enselic](https://github.com/Enselic)\n\n## Security vulnerabilities\n\nPlease contact [David Peter](https://david-peter.de/) via email if you want to report a vulnerability in `bat`.\n\n## Project goals and alternatives\n\n`bat` tries to achieve the following goals:\n\n- Provide beautiful, advanced syntax highlighting\n- Integrate with Git to show file modifications\n- Be a drop-in replacement for (POSIX) `cat`\n- Offer a user-friendly command-line interface\n\nThere are a lot of alternatives, if you are looking for similar programs. See\n[this document](doc/alternatives.md) for a comparison.\n\n## License\nCopyright (c) 2018-2023 [bat-developers](https://github.com/sharkdp/bat).\n\n`bat` is made available under the terms of either the MIT License or the Apache License 2.0, at your option.\n\nSee the [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) files for license details.\n","funding_links":["https://github.com/sponsors/sharkdp"],"categories":["Install Vundle","Rust","HarmonyOS","应用","Applications","Files and Directories","Uncategorized","Other Tools","Tools/Scripts/Code:","开源工具","inbox","CLI tools","Command Line Utilities","User Interaction","应用程序 Applications","Pagers","Tools","Rust (6)","Terminal Commands","cat","Command Line Tools","Interaction","Tech","Productivity Tools","Weapons","Tool","File Manipulation","Command Line Apps","Examples","应用 Applications","Text Processing","Rust (42)","Others","Command Line","其他","🛠️ Productivity","Terminal","Table of Contents","语言资源库","开发者工具",":hammer_and_wrench: My Tools","Awesome Tools","CLIs \u0026 Terminal Tools","⚡ Productivity","git","Programming Languages","后端 \u003ca name=\"backend\"\u003e\u003c/a\u003e","cli","Features","System Utilities","命令行工具","terminal","Developer Tools","🐧 Linux","Shell","\u003ca name=\"viewers\"\u003e\u003c/a\u003eViewers","\\*nix/\\*nux","Command-line","System \u0026 Command","Repository app","tools","Lovely Commands","Miscellaneous Tools","File Management","File","Languages and frameworks","Command line - Linux","Cat Replacement","工具","Modern Unix Replacements","Bash","Productivity and Workflow Tools","Text utils","Mac 软件","Resources","Developer Tools | 开发者工具","\u003ca name=\"core\"\u003e\u003c/a\u003ecore"],"sub_categories":["Caveats","Windows Manager","System tools","Files","Uncategorized","Bonus","命令行工具","Tools","Command Line Interface","系统工具 System tools","bat","Command Line","Follow me","Windows CLI apps","系统工具","Less uncommon words","Other","Libs","Dependency Management","网络服务_其他","☸️ Kubernetes","Smart Shell","Dev Tools","Rust","rust",":floppy_disk: My Software","Terminal Tools","Useful Linux Tools","My Developer Environment","Directory Navigation","Command Line Tools","shell","CLI Tools","PCAP","Terminal","Shell","Learning resources","Open USP Tsukubai","多模态","CLIs \u0026 Terminal Tools","Multiplexers","命令行","Command-Line Tools","CLI Tools | 命令行工具"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharkdp%2Fbat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharkdp%2Fbat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharkdp%2Fbat/lists"}