Code Monkey home page Code Monkey logo

base16-shell-legacy's Introduction

Base16 Shell

See the Base16 repository for more information.

A shell script to change your shell's default ANSI colors but most importantly, colors 17 to 21 of your shell's 256 colorspace (if supported by your terminal). This script makes it possible to honor the original bright colors of your shell (e.g. bright green is still green and so on) while providing additional base16 colors to applications such as Vim and tmux.

Base16 Shell

Use Cases

  • You want to use a *.256.* variant of a Terminal theme designed to honor the original bright colors.
  • You prefer to use a script instead of a terminal emulator theme to color your shell.
  • You use this script to have different colorschemes appear on different SSH sessions.

Installation

git clone https://github.com/base16-project/base16-shell.git \
  $HOME/.config/base16-shell

Bash/ZSH

Add following lines to .bashrc or .zshrc:

# Base16 Shell
BASE16_SHELL_PATH="$HOME/.config/base16-shell"
[ -n "$PS1" ] && \
  [ -s "$BASE16_SHELL_PATH/profile_helper.sh" ] && \
    source "$BASE16_SHELL_PATH/profile_helper.sh"

Oh my zsh

mkdir $HOME/.oh-my-zsh/plugins/base16-shell
ln -s $HOME/.config/base16-shell/base16-shell.plugin.zsh \
  $HOME/.oh-my-zsh/plugins/base16-shell/base16-shell.plugin.zsh

To use it, add base16-shell to the plugins array in your .zshrc file:

plugins=(... base16-shell)

Fish

Add following lines to $HOME/.config/fish/config.fish:

# Base16 Shell
if status --is-interactive
  set BASE16_SHELL_PATH "$HOME/.config/base16-shell"
  source "$BASE16_SHELL_PATH/profile_helper.fish"
end

Configuration

Base16-Vim Users

Vim

The BASE16_THEME environment variable will set to your current colorscheme. You can set the base16-vim colorscheme to the BASE16_THEME environment variable by adding the following to your .vimrc:

if exists('$BASE16_THEME')
    \ && (!exists('g:colors_name') 
    \ || g:colors_name != 'base16-$BASE16_THEME')
  let base16colorspace=256
  colorscheme base16-$BASE16_THEME
endif

Remove the base16colorspace line if it is not needed.

Neovim

If you have a lua neovim config, add the following to your init.lua:

local cmd = vim.cmd
local g = vim.g

local base16_project_theme = os.getenv('BASE16_THEME')
if base16_project_theme and g.colors_name ~= 'base16-'..base16_project_theme then
  cmd('let base16colorspace=256')
  cmd('colorscheme base16-'..base16_project_theme)
end

Base16-Tmux Users

This section is for base16-tmux users. base16-shell will update (or create) the $HOME/.config/base16-project/tmux.base16.conf file and set the colorscheme. You need to source this file in your .tmux.conf. You can do this by adding the following to your .tmux.conf:

source-file $HOME/.config/base16-project/tmux.base16.conf

Make sure to reload your .tmux.conf file after the theme has been updated through profile_helper.

Keeping your themes up to date

To update, just git pull wherever you've cloned base16-shell. The themes are updated on a weekly basis thanks to GitHub Actions. See the GitHub Actions workflow in .github/workflows/update.yml.

Default theme

You can set the $BASE16_THEME_DEFAULT environment variable to the name of a theme and it will use that theme if there is no theme currently set. This can be useful for when you're using your dotfiles in a brand new environment and you don't want to manually set the theme for the first time.

For example: $BASE16_THEME_DEFAULT="solarized-light"

Usage

Open a new shell and type base16 followed by a tab to perform tab completion.

Troubleshooting

Run the included colortest script and check that your colour assignments appear correct. If your teminal does not support the setting of colours in within the 256 colorspace (e.g. Apple Terminal), colours 17 to 21 will appear blue.

setting 256 colourspace not supported

If colortest is run without any arguments e.g. ./colortest the hex values shown will correspond to the default scheme. If you'd like to see the hex values for a particular scheme pass the file name of the theme as the arguement e.g. ./colortest base16-ocean.sh.

Inverted blacks and whites

This is the expected behaviour when using a light theme: https://github.com/base16-project/base16-shell/issues/150

Contributing

See CONTRIBUTING.md, which contains building and contributing instructions.

base16-shell-legacy's People

Contributors

alecmev avatar andrew-ko avatar blueyed avatar chriskempson avatar danielrs avatar diegs avatar dsapala avatar fnune avatar ghprince avatar hashbang173 avatar iandrewt avatar ipatch avatar jamygolden avatar johnmorales avatar julio-b avatar junzh0u avatar klebercode avatar ksrb avatar mattaw avatar nawetimebomb avatar nomoon avatar nvllsvm avatar ondono avatar sid-maddy avatar solaraquarion avatar sryze avatar tinted-theming-bot avatar tylerball avatar vassilevsky avatar vifo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

base16-shell-legacy's Issues

[Bug report] Config folder requires manual creation after yesterday's update

Describe the bug

when settings a new theme with a fresh install, it attempts to create a symlink to $BASE_SHELL_COLORSCHEME_PATH, but the $BASE16_CONFIG_PATH directory doesn't yet exist, so it errors, and the theme won't be set next time the shell starts.

Expected behavior

$BASE16_CONFIG_PATH directory to be created automatically, so the symlink is created successfully

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.