A cat(1) clone with wings.
bat --list-languages
is called, see #1394 (@stku1985)--style=plain
, see #1438 (@Enselic)bat --list-themes
), see #1439 (@rsteube)PAGER
(but not BAT_PAGER
or --pager
) is more
or most
, silently use less
instead to ensure support for colors, see #1063 (@Enselic)PAGER
is bat
, silently use less
to prevent recursion. For BAT_PAGER
or --pager
, exit with error, see #1413 (@Enselic)BAT_CONFIG_PATH
ignored by bat
if non-existent, see #1550 (@sharkdp)--diagnostic
option to collect information for bug reports, see #1459 (@sharkdp).resource
extension for Robot Framework files, see #1386gnuplot
syntax, see #1431 (@sharkdp)ansi
replaces ansi-dark
and ansi-light
, see #1104 and #1412 (@mk12). Breaking change: users that were previously using one of the ansi-*
themes should switch to ansi
.gruvbox
or gruvbox-white
should update and use gruvbox-dark
/gruvbox-light
instead.bat
as a libraryPrettyPrinter
methods have been removed (they were previously deprecated):
input_stdin_with_name
input_from_bytes_with_name
input_from_reader_with_name
vcs_modification_markers
(if the git
feature is not enabled)--style
value, rule
, which adds a simple horizontal ruled line between files, see #1276 (@tommilligan)-S
("chop long lines") to less
if --wrap=never
is set in bat
, see #1255 (@gahag)bat
is being used as pager
, see #1343 (@adrian-rivera)*.ebuild
and *.eclass
files, see #1292 (@sharkdp)zsh
completion when using -p
, see #1320 (@xzfc)--help
(and vice versa with -h
), see #1215 (@henil)Contributors
section to README
, see #1348 (@adrian-rivera)NO_COLOR
environment variable, see #1021 and #1031 (@eth-p)-P
short flag to disable paging, see #1075 and #1082 (@LordFlashmeow)--force-colorization
/-f
flag to provide an alias for forced color and decoration output, see #1141 (@alexanderkarlis)--list-languages
, see #1076 and #1135 (@Kienyew)--help
text (@sharkdp)fstab
syntax for crypttab
files, see #1073 (@sharkdp)$XDG_CONFIG_HOME/git/
, see #1191 (@ahmedelgabri)bat
as a libraryInput
descriptions with InputDescription
(@eth-p)Input
s to PrettyPrinter
(@eth-p)Input::theme_preview_file
is no longer available. (@eth-p)liquid
(@sharkdp).Special thanks to @rivy for porting our CI/CD workflows to Github Actions. Also, many thanks to @Kienyew and @eth-p for major contributions!
Warning: this release suffers from #1022. bat
will panic when called with a relative file path.
--map-syntax
doesn't work with names provided through --file-name
(@eth-p)-l
or --map-syntax
, see #1004 (@eth-p)bat
as a libraryPrettyPrinter::vcs_modification_markers
has been marked deprecated when building without the git
feature, see #997 and #1020 (@eth-p, @sharkdp)onig_sys
on various platforms have been resolved by upgrading to syntect 4.2
, which includes a new onig
version that allows to build onig_sys
without the bindgen
dependency. This removes the need for libclang(-dev)
to be installed to compile bat
. Package maintainers might want to remove clang
as a build dependency. See #650 for more details.base16
theme (was broken since in v0.14), see #972, #934 and #979 (@mk12).
Users suffering from #865 ("no color for bat in ssh from a Windows client") can use the ansi-dark
and ansi-light
themes from now on.This release adds a new --diff
/-d
option that can be used to only show lines surrounding Git changes, i.e. added, removed or modified lines. The amount of additional context can be controlled with --diff-context=N
. See #23 and #940
You can use a bash function like
batdiff() {
git diff --name-only --diff-filter=d 2>/dev/null | xargs bat --diff
}
to essentially get a version of git diff
with syntax highlighting (but without being able to see the old version).
bat cache --build
): the bat
startup time should now be twice as fast (@lzutao).bat
as a libraryConfig
struct has changed and
the error handler needs a new &mut dyn Write
argument). The high-level API is not
affected.--file-name <name>…
option to overwrite the displayed filename(s)
in the header. This is useful when piping input into bat
. See #654 and #892 (@neuronull).--generate-config-file
option to create an initial configuration file
at the right place. See #870 (@jmick414)--highlight-line
did not work correctly in combination with --tabs=0
and --wrap=never
,
see #937bat
will now maintain a
metadata.yaml
file which includes information about the bat
version which was
used to create the cached files. When loading cached files, we now print an error
if they have been created with an incompatible version. See #882liquid
dependency to 0.20, see #880 (@ignatenkobrain)bat
as a libraryA completely new "high level" API has been added that is much more convenient
to use. See the examples
folder for the updated code. The older "low level"
API is still available (basically everything that is not in the root bat
module), but has been refactored quite a bit. It is recommended to only use
the new "high level" API, if possible. This will be much easier to keep stable.
Note that this should still be considered a "beta" release of bat
-as-a-library.
For more details and some screenshots of the example programs, see #936.
Stripped out a lot of binary-only dependencies, see #895 and #899 (@dtolnay)
This introduces a features = ["application"]
which is enabled by default and pulls in
everything required by bat
the application. When depending on bat as a library, downstream
Cargo.toml
should disable this feature to cut out inapplicable heavy dependencies:
[dependencies]
bat = { version = "0.14", default-features = false, features = ["regex-onig"] }
Other optional functionality has also been put behind features: paging
and git
support.
Allow using the library with older syntect, see #896 and #898 (@dtolnay)
Many thanks to @keith-hall for all the help with various Sublime syntax problems!