Releases: sharkdp/bat
v0.15.0
Features
-
This release adds a new
--diff/-doption 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 #940You 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 diffwith syntax highlighting (but without being able to see the old version).
Bugfixes
- Error message printed in the middle of the output for another file, see #946
- Performance improvements when using custom caches (via
bat cache --build): thebatstartup time should now be twice as fast (@lzutao).
Themes
- Updated version of the Solarized dark/light themes, see #941
bat as a library
- There are a few changes in the "low level" API (the
Configstruct has changed and
the error handler needs a new&mut dyn Writeargument). The high-level API is not
affected.
v0.14.0
Features
- Added a new
--file-name <name>…option to overwrite the displayed filename(s)
in the header. This is useful when piping input intobat. See #654 and #892 (@neuronull). - Added a new
--generate-config-fileoption to create an initial configuration file
at the right place. See #870 (@jmick414)
Bugfixes
- Performance problems with C# source code have been fixed, see #677 (@keith-hall)
- Performance problems with Makefiles have been fixed, see #750 (@keith-hall)
- Fix bug when highlighting Ruby files with unindented heredocs, see #914 (@keith-hall)
- A highlighting problem with Rust source code has been fixed, see #924 (@keith-hall)
- Windows: short files that do not require paging are displayed and then lost, see #887
--highlight-linedid not work correctly in combination with--tabs=0and--wrap=never,
see #937
Other
- When saving/reading user-provided syntaxes or themes,
batwill now maintain a
metadata.yamlfile which includes information about thebatversion 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 #882 - Updated
liquiddependency to 0.20, see #880 (@ignatenkobrain)
bat as a library
-
A completely new "high level" API has been added that is much more convenient
to use. See theexamplesfolder for the updated code. The older "low level"
API is still available (basically everything that is not in the rootbat
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 ofbat-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 bybatthe application. When depending on bat as a library, downstream
Cargo.tomlshould 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:
pagingandgitsupport. -
Allow using the library with older syntect, see #896 and #898 (@dtolnay)
New syntaxes
- Rego, see #872 (@patrick-east)
- Stylo, see #917
Thanks
Many thanks to @keith-hall for all the help with various Sublime syntax problems!
v0.13.0
bat as a library
Beginning with this release, bat can be used as a library (#423).
This was a huge effort and I want to thank all people who made this possible: @DrSensor, @mitsuhiko, @mre, @eth-p!
- Initial attempt in #469 (@mitsuhiko)
- Second attempt, complete restructuring of the
batcrate, see #679 (@DrSensor) - Updates to example, public API, error handling, further refactoring: #693 #873 #875 (@sharkdp)
I want to stress that this is the very first release of the library. Things are very likely to change. A lot of things are still missing (including the documentation).
That being said, you can start using it! See the example programs in examples/.
You can see the API documentation here: https://docs.rs/bat/
Features
-
(Breaking change) Glob-based syntax mapping, see #877 and #592. With this change,
users need to update their bat config files (bat --config-file), if they have any--map-syntaxsettings
present.The option now works like this:
--map-syntax <glob-pattern>:<syntax-name>
For more information, see the
--helptext, the man page or the README.This new feature allows us to properly highlight files like:
/etc/profile~/.ssh/config
-
--highlight-linenow accepts line ranges, see #809 (@lkalir) -
Proper wrapping support for output with wide Unicode characters, see #811 #787 and #815 (@Kogia-sima)
-
A lot of updates to existing syntaxes via #644 (@benwaffle, @keith-hall)
-
BAT_CACHE_PATHcan be used to place cachedbatassets in a non-standard path, see #829 (@neuronull) -
Support combination of multiple styles at the same time, see #857 (@aslpavel)
Bugfixes
- Do not pass '--no-init' on newer less versions, see #749 and #786 (@sharkdp)
- 'bat cache' still takes precedence over existing files, see #666 (@sharkdp)
.scfiles should be treated as scala files, see #443 (@benwaffle)- Allow underscores and dashes in page names, see #670 (@LunarLambda)
- Keep empty lines empty, see #601 (@mbarbar)
- Wrapping does not work when piping, see #758 (@fusillicode, @allevo, @gildo)
- Allow for non-unicode filenames, see #225 (@sharkdp)
- Empty file without header produces incomplete grid, see #798 (@eth-p)
- Files named
builddon't respect shebang lines, see #685 (@sharkdp)
Other
- Parametrizable names for man page and shell completion files, see #659 #673 #656 (@eth-p)
- Enabled LTO, making
batabout 10% faster, see #719 (@bolinfest, @sharkdp) - Suggestions non how to configure
batfor MacOS dark mode, see README (@jerguslejko) - Extended "Integration with other tools" section (@eth-p)
- Updated instrutions on how to use
batas aman-pager, see #652, see #667 (@sharkdp) - Add section concerning file encodings, see #688 and #568 (@sharkdp)
- Updated sort order of command-line options in
--helptext and manpage, see #653 and #700 (@hrlmartins) - Updates to the man page syntax, see #718 (@sharkdp)
- Japanese documentation updates, see #863 (@k-ta-yamada, @sorairolake and @wt-l00)
- Accept "default" as a theme, see #757 (@fvictorio)
- Updated Windows installation instructions, see #852 (@sorenbug)
- Updated man page, see #573 (@sharkdp)
New syntaxes
- Jinja2, see #648 (@Martin819)
- SaltStack SLS, see #658 (@Martin819)
/etc/fstab, see #696 (@flopp and @eth-p)/etc/groupand/etc/passwd, see #698 (@argentite)/proc/cpuinfoand/proc/meminfo, see #593 (@sharkdp)- Nim, see #542 (@sharkdp)
- Vue, see #826 (@chaaaaarlotte)
- CoffeScript, see #833 (@sharkdp)
New themes
- Dracula, see #687 (@clarfon)
- Nord, see #760 (@crabique)
- Solarized light and dark, see #768 (@hakamadare)
Packaging
batis now in the official Ubuntu and Debian repositories, see #323 and #705 (@MarcoFalke)batcan now be installed via MacPorts, see #675 (@bn3t)- Install fish completions into 'vendor_completions.d', see #651 (@sharkdp)
Thanks
v0.12.1
v0.12.0
Features
- Binary file content can now be viewed with
bat -A, see #623, #640 (@pjsier and @sharkdp) batcan now be used as a man pager. Take a look at the README and #523 for more details.- Add new style component to separate multiple
--line-ranges, see #570 (@eth-p) - Added
-Las an alias for--list-languages
Bugfixes
- Output looks unbalanced when using '--style=grid,numbers' without 'header', see #571 (@eth-p)
- issues with filenames starting with "cache", see #584
- Can't build cache with new theme without creating cache dir, see #576 (@frm)
--terminal-width -10is parsed incorrectly, see #611
Other
- Added fish completions to DEB package, see #554
New syntaxes
- Emacs Org mode, see #36 (@bricewge)
requirements.txt- DotENV
.env - SSH config syntax (
-l ssh_config), see #582 (@issmirnov) /etc/hosts, see #583 (@issmirnov)- GraphQL, see #625 (@dandavison)
- Verilog, see #616
- SCSS and Sass, see #637
stracesyntax, see #599
Packaging
batis now in the official Gentoo repositories, see #588 (@toku-sa-n)batis now in the official Alpine Linux repositories, see #586 (@5paceToast)batis in the official Fedora repositories, see #610 (@ignatenkobrain)
v0.11.0
Features
- Three new special color themes are available:
ansi-light,ansi-darkandbase16. These
are useful for people that often switch from dark to light themes in their terminal emulator
or for people that want the colors to match their terminal theme colors. For more details,
see #543 and #490 (@mk12, implementation idea by @trishume) - Hand-written auto completion script for Fish shell, see #524 and #555 (@ev-dev and @eth-p)
- The
-p/--plainoption can now be used twice (typically-pp). The first-pswitches the
--styleto "plain". The second-pdisables the pager. See #560 and #552 (@eth-p)
Bugfixes
- Do not replace arguments to
lesswhen using--pager, see #509 - Binary files will now be indicated by a warning in interactive mode, see #530 #466 #550 (@maxfilov)
- Empty files are (once again) printed with a single header line, see #504 and #566 (@reidwagner
and @sharkdp) --terminal-width=0is now disallowed, see #559 (@eth-p)- Accidental printing of files named
cache, see #557
Other
- New integration tests, see #500 and #502 (@reidwagner and @sharkdp)
- New "Integration with other tools" section in the README.
- Migrated to Rust 2018 (@expobrain)
New syntaxes
- F# syntax has been updated, see #531 (@stroborobo)
- Fish shell, see #548 (@sanga)
Packaging
batis now available on Chocolatey, see #541 (@rasmuskriest)
v0.10.0
Features
Changes
- Change the default configuration directory on macOS to
~/.config/bat, see #442 (@lavifb). If you are on macOS, you need to copy your configuration directory from the previous place (~/Library/Preferences/bat) to the new place (~/.config/bat). - Completely disabled the generation of shell completion files, see #372
- Properly set arguments to
lessifPAGERenvironment variable contains something likeless -F(which is missing the-Roption), see #430 (@majecty) - Report the name of missing files, see #444 (@ufuji1984)
- Don't start pager if file doesn't exist, see #387
- Rename
bat cache --inittobat cache --build, see #498 - Move the
--config-dirand--cache-diroptions frombat cachetobatand hide them from the help text.
Bugfixes
- Blank line at the end of output when using
--style=plain, see #379 - EOF must be sent twice on stdin if no other input is sent, see #477 (@reidwagner)
New syntaxes
- Twig (@ahmedelgabri)
.desktopfiles (@jleclanche)- AsciiDoc (@markusthoemmes)
- Assembly (x86_64 and ARM)
- Log files (@caos21)
- Protobuf and ProtobufText (@caos21)
- Terraform (@caos21)
- Jsonnet (@hfm)
- Varlink (@haraldh)
Other
- Added Japanese version of README (@sh-tech and @object1037)
- Code improvements (@barskern)
v0.9.0
Features
-
A new
-A/--show-alloption has been added to show and highlight non-printable characters (in analogy to GNUcats option): -
Added
--pageroption (to configure the pager from the configuration file), see #362 (@majecty) -
Added
BAT_CONFIG_PATHenvironment variable to set a non-default path forbats configuration file, see #375 (@deg4uss3r) -
Allow for multiple occurences of
--styleto allow for the configuration
of styles from the config file, see #367 (@sindreij) -
Allow for multiple
--line-rangearguments, see #23 -
The
--terminal-widthoption can now also accept offsets, see #376
Changes
-
Use of italics is now disabled by default (see #389 for details). They can be
re-enabled by adding--italic-text=alwaysto your configuration file. -
The default tab-width has been set to 4.
-
Added new "Sublime Snazzy" theme.
-
Shell completions are currently not shipped anymore, see #372 for details.
Bugfixes
Other
-
Added section about the new configuration file in the README (@deg4uss3r)
-
Chinese translation of README (@chinanf-boy)
-
Re-written tests for
--tabs(@choznerol) -
Speed up integration tests, see #394
v0.8.0
Features
-
Support for a configuration file with the following simple format:
--tabs=4 --theme="Sublime Snazzy" # A line-comment --map-syntax .ignore:.gitignore --map-syntax PKGBUILD:bash --map-syntax Podfile:ruby # Flags and options can also be on a single line: --wrap=never --paging=never
The configuration file path can be accessed via
bat --config-file. On Linux,
it is stored in~/.config/bat/config. -
Support for the
BAT_OPTSenvironment variable with the same format as specified
above (in a single line). This takes precedence over the configuration file.See also #310.
-
Support for custom syntax mappings via the
-m/--max-syntaxoption.This allows users to (re)map certain file extensions or file names to an existing syntax:
bat --map-syntax .config:json ...
The option can be use multiple times. Note that you can easily make these mappings permanent by using bats new configuration file.
See #169
-
Support pager command-line arguments in
PAGERandBAT_PAGER, see #352 (@Foxboron) -
First-line syntax detection for all input types, see #205
-
Encoding support for UTF-16LE and UTF-16BE, see #285
-
New syntaxes: Robot framework (@sanga)
Changes
- Binary files are now detected and not displayed when the output goes to an interactive terminal, see #205
Bugfixes
-
JavaDoc comments break syntax highlighting in .java files, see #81
-
Bat Panics on Haskell Source Code, see #314
Other
-
Better
-hand--helptexts. -
Updated documentation on how to configure
bats pager -
Updated documentation for light backgrounds, see #328 (@russtaylor)
-
Generate shell completions during build, see #115 (@davideGiovannini)
-
A lot of new tests have been written
-
batis now available via nix, see #344 (@mgttlinger)
