bat icon indicating copy to clipboard operation
bat copied to clipboard

Default colorschemes for light terminals

Open jadennnn opened this issue 8 years ago • 11 comments

Hi! I just found this tool and it would be super nice if there was a way to use it for terminals with a light background color (e.g. solarized light). I'm just hoping there's a quick way to provide a dark colorscheme by default.

Thanks alot for making this!

jadennnn avatar May 01 '18 09:05 jadennnn

Thank you for the feedback.

Yes, there should be a way to easily configure the highlighting theme (see also #1).

In the meantime, you could try to do this (see "Customization" section in the README):

# Get theme
mkdir -p ~/.config/bat/themes
cd ~/.config/bat/themes
git clone https://github.com/braver/Solarized
ln -sf "Solarized/Solarized (light).tmTheme" Default.tmTheme

# Get language definition files
mkdir -p ~/.config/bat/syntaxes
cd ~/.config/bat/syntaxes
git clone https://github.com/sublimehq/Packages/
rm -rf Packages/Markdown
git clone https://github.com/jonschlinkert/sublime-markdown-extended

# Initialize cache
bat cache --init

sharkdp avatar May 01 '18 09:05 sharkdp

Wow thank you this worked perfectly :smiley:

jadennnn avatar May 02 '18 13:05 jadennnn

Thanks! Tried this, two errors with the 0.2.3 binary Mac release:

  1. Init-cache seems to use ~/L/P/bat, not .config?
⋊> ~ bat init-cache                                                                          10:09:20
[bat error]: Could not load themes from '/Users/nevyn/Library/Preferences/bat/themes'
  1. Tried remedying with ln -s ~/.config/bat/themes ~/Library/Preferences/bat/themes. Now I no longer have syntax highlighting, everything's rendering gray o_O
screen shot 2018-05-03 at 10 10 03

nevyn-lookback avatar May 03 '18 08:05 nevyn-lookback

Init-cache seems to use ~/L/P/bat, not .config?

On macOS - yes. I should update this in the README.

Tried remedying with ln -s ~/.config/bat/themes ~/Library/Preferences/bat/themes. Now I no longer have syntax highlighting, everything's rendering gray o_O

You can always reset everything by removing the cache folder (~/Library/Caches/bat).

sharkdp avatar May 06 '18 09:05 sharkdp

Even without customization, you should now be able to use

bat --theme="Monokai Extended Light" README.md

sharkdp avatar May 18 '18 17:05 sharkdp

In the script described above, I had to replace ~/.config/bat/syntax by ~/.config/bat/syntaxes, as described in the README.

pylipp avatar Jun 12 '18 15:06 pylipp

@pylipp Thanks. I have adapted my comment above.

sharkdp avatar Jun 12 '18 18:06 sharkdp

For anyone coming here and cloning the braver/Solarized repo, note that they’ve converted to sublime-theme format. You can clone the older tmTheme version by git checkout 87e01090cf after you clone the repo.

jeffbyrnes avatar Sep 06 '18 14:09 jeffbyrnes

Another way of handing what @jeffbyrnes brings up: git checkout -b b1.6.0 1.6.0 that way you use the tag they have in the repo.

markkrueger avatar Dec 19 '18 23:12 markkrueger

bat cache --init no longer works and should be replaced by bat cache --build

FlyingFoX avatar Sep 13 '24 19:09 FlyingFoX

A solarized light theme is now available in the standard install and can be used with --theme="Solarized (light)".

FlyingFoX avatar Sep 13 '24 19:09 FlyingFoX