π¦ Bat into Tokyo Night π
Install / Update Tokyo Night syntax highlight theme for
bat
.
bat
supports Sublime Text theme and syntax highlighting definition files.
So we can use *.tmTheme
files in extras/sublime/
directory at
folke/tokyonight.nvim repository. This is delightful for some, like me!
Here is the script that adds Folke's edition of Tokyo Night theme to bat
.
It automates the tedious install (git clone
), update (git pull
)
and build (bat cache --build
) process.
The installation is not a simple clone. In here, there are only a few files in
folke/tokyonight.nvim that are actually needed for us.
The majority of files should be ignored and not saved.
For instance, README.md
, lua/
, colors/
, etc.
Similarly, for updates, superfluous files should not be checked.
And the build is executed only when there are updates.
- Install if not installed
tokyonight_day
tokyonight_moon
tokyonight_night
tokyonight_storm
- Update if there are updates
- Build a cache if the themes are expired
git clone https://github.com/0xTadash1/bat-into-tokyonight
cd bat-into-tokyonight
./bat-into-tokyonight
I recommend you to do (./bat-into-tokyonight >/dev/null 2>&1 &)
in a file such as .bashrc
or .zshrc
.
- Use a environment variable: i.e.
export BAT_THEME="tokyonight_night"
- Use a option with
bat
: i.e.bat --theme="tokyonight_storm"
- Use a option in a config file for
bat
Remove this plugin directory, and then:
command rm -rf "$(command bat --config-dir)/themes/tokyonight.nvim/"
command bat cache --build
I prefer the colors of Folke flavored Tokyo Night theme.
Enkia, probably the original creator of Tokyo Night, also makes a Sublime Text theme. If you prefer the original author's, you should use that. It's much stable.