Home

Awesome

<img src="http://rawgit.com/caiogondim/bullet-train-oh-my-zsh-theme/master/img/icon.svg" width="100%" />

Bullet Train for oh-my-zsh <a href="http://webchat.freenode.net/?channels=bullettrain-sh" target="_blank"><img src="https://img.shields.io/badge/IRC-bullettrain–sh-1e72ff.svg?style=flat" height="20"></a>

Bullet Train is a oh-my-zsh shell theme based on the Powerline Vim plugin. It aims for simplicity, showing information only when it's relevant.

It currently shows:

If you want add some new feature, of fix some bug, open an issue and lets hack together.

For a tmux theme to work with it, I suggest Maglev.

Preview

Preview

Requirements

In order to use the theme, you will first need:

Installing

For oh-my-zsh users

  1. Download the theme here

  2. Put the file bullet-train.zsh-theme in $ZSH_CUSTOM/themes/

  3. Configure the theme in your ~/.zshrc file:

ZSH_THEME="bullet-train"

For antigen users

Add the following snippet to your .zshrc somewhere after the line antigen use oh-my-zsh.

antigen theme https://github.com/caiogondim/bullet-train-oh-my-zsh-theme bullet-train

For Zgen users

If you're using zgen, add the following line to your ~/.zshrc where you're adding your other zsh plugins after the line zgen oh-my-zsh.

zgen load caiogondim/bullet-train-oh-my-zsh-theme bullet-train

For Zplug users

If you're using zplug, add the following line to your ~/.zshrc where you're adding your other zsh plugins.

setopt prompt_subst # Make sure prompt is able to be generated properly.
zplug "caiogondim/bullet-train.zsh", use:bullet-train.zsh-theme, defer:3 # defer until other plugins like oh-my-zsh is loaded

Options

Bullet Train is configurable. You can change colors and which segments you want or don't want to see. All options must be overridden in your .zshrc file.

Order

BULLETTRAIN_PROMPT_ORDER defines order of prompt segments. Use zsh array syntax to specify your own order, e.g:

BULLETTRAIN_PROMPT_ORDER=(
  git
  context
  dir
  time
)

NOTE: You do not need to specify end segment - it will be added automatically. With this you can also specify custom segments.

Prompt

VariableDefaultMeaning
BULLETTRAIN_PROMPT_CHAR\$Character to be show before any command
BULLETTRAIN_PROMPT_ROOTtrueHighlight if running as root
BULLETTRAIN_PROMPT_SEPARATE_LINEtrueMake the prompt span across two lines
BULLETTRAIN_PROMPT_ADD_NEWLINEtrueAdds a newline character before each prompt line

Status

VariableDefaultMeaning
BULLETTRAIN_STATUS_EXIT_SHOWfalseShow/hide exit code of last command
BULLETTRAIN_STATUS_BGgreenBackground color
BULLETTRAIN_STATUS_ERROR_BGredBackground color of segment when last command exited with an error
BULLETTRAIN_STATUS_FGblackForeground color

Time

VariableDefaultMeaning
BULLETTRAIN_TIME_12HRfalseFormat time using 12-hour clock (am/pm)
BULLETTRAIN_TIME_BGwhiteBackground color
BULLETTRAIN_TIME_FGblackForeground color

Custom

VariableDefaultMeaning
BULLETTRAIN_CUSTOM_MSGfalseFree segment you can put a custom message which will be eval'ed for every prompt
BULLETTRAIN_CUSTOM_BGblackBackground color
BULLETTRAIN_CUSTOM_FGdefaultForeground color

Context

VariableDefaultMeaning
BULLETTRAIN_CONTEXT_BGblackBackground color
BULLETTRAIN_CONTEXT_FGdefaultForeground color
BULLETTRAIN_CONTEXT_DEFAULT_USERnoneDefault user. If you are running with other user other than default, the segment will be showed.
BULLETTRAIN_CONTEXT_HOSTNAME%mHostname. Set %M to display the full qualified domain name.
BULLETTRAIN_IS_SSH_CLIENTnoneIf true, the segment will be showed.

Python virtualenv (+Pyenv)

VariableDefaultMeaning
BULLETTRAIN_VIRTUALENV_BGyellowBackground color
BULLETTRAIN_VIRTUALENV_FGwhiteForeground color
BULLETTRAIN_VIRTUALENV_PREFIX🐍Prefix of the segment

node.js nvm

VariableDefaultMeaning
BULLETTRAIN_NVM_BGgreenBackground color
BULLETTRAIN_NVM_FGwhiteForeground color
BULLETTRAIN_NVM_PREFIX"⬡ "Prefix of the segment

Ruby RVM/Rbenv

VariableDefaultMeaning
BULLETTRAIN_RUBY_BGmagentaBackground color
BULLETTRAIN_RUBY_FGwhiteForeground color
BULLETTRAIN_RUBY_PREFIX"♦"Prefix of the segment

Elixir

VariableDefaultMeaning
BULLETTRAIN_ELIXIR_BGmagentaBackground color
BULLETTRAIN_ELIXIR_FGwhiteForeground color
BULLETTRAIN_ELIXIR_PREFIX"💧"Prefix of the segment

Go

VariableDefaultMeaning
BULLETTRAIN_GO_BGgreenBackground color
BULLETTRAIN_GO_FGwhiteForeground color
BULLETTRAIN_GO_PREFIXgoPrefix of the segment

Kubernetes Context

VariableDefaultMeaning
BULLETTRAIN_KCTX_BGyellowBackground color
BULLETTRAIN_KCTX_FGwhiteForeground color
BULLETTRAIN_KCTX_PREFIXKubernetes prefix of the segment
BULLETTRAIN_KCTX_KUBECTLtrueIf false disable kubectl usage
BULLETTRAIN_KCTX_NAMESPACEtrueIf false will not show the default namespace. Namespace is only visible if kubectl is installed
BULLETTRAIN_KCTX_KCONFIG${HOME}/.kube/configLocation of kube config file (e.g. /Users/Hugo/.kube/config)

The prompt will first check if BULLETTRAIN_KCTX_KUBECTL=true and kubectl is installed than it will use kubectl config view --minify to determine the context and default namespace in use. If BULLETTRAIN_KCTX_KUBECTL=false or kubectl is not installed, BULLETTRAIN_KCTX_KCONFIG will be parsed to get the current context.

The usage of kubectl allow the prompt to get the default namespace even if you are using multiple kube config files (e.g. KUBECONFIG=~/.kube/config:path-to-config1:path-to-config2)

AWS Profile

Displays which AWS (Amazon Web Services) credentials profile is currently set. This environment var is used by aws-cli and other tools to use the right access keys and other parameters.

VariableDefaultMeaning
BULLETTRAIN_AWS_BGyellowBackground color
BULLETTRAIN_AWS_FGblackForeground color
BULLETTRAIN_AWS_PREFIX☁️Prefix of the segment

Perl

VariableDefaultMeaning
BULLETTRAIN_PERL_BGyellowBackground color
BULLETTRAIN_PERL_FGblackForeground color
BULLETTRAIN_PERL_PREFIX🐪Prefix of the segment

Dir

VariableDefaultMeaning
BULLETTRAIN_DIR_BGblueBackground color
BULLETTRAIN_DIR_FGwhiteForeground color
BULLETTRAIN_DIR_CONTEXT_SHOWfalseShow user and machine in an SCP formatted style
BULLETTRAIN_DIR_EXTENDED1Extended path (0=short path, 1=medium path, 2=complete path, everything else=medium path)

Git

VariableDefaultMeaning
BULLETTRAIN_GIT_COLORIZE_DIRTYfalseSet BULLETTRAIN_GIT_BG to BULLETTRAIN_GIT_COLORIZE_DIRTY_COLOR in dirty state
BULLETTRAIN_GIT_COLORIZE_DIRTY_BG_COLORyellowBULLETTRAIN_GIT_BG in dirty state
BULLETTRAIN_GIT_COLORIZE_DIRTY_FG_COLORblackBULLETTRAIN_GIT_FG in dirty state
BULLETTRAIN_GIT_BGwhiteBackground color
BULLETTRAIN_GIT_FGblackForeground color
BULLETTRAIN_GIT_PROMPT_CMDgit_prompt_infoFunction to display details about your git segment.
BULLETTRAIN_GIT_EXTENDEDtrue
BULLETTRAIN_GIT_PREFIX""Prefix
BULLETTRAIN_GIT_SUFFIX""Suffix
BULLETTRAIN_GIT_DIRTY"✘"Icon for dirty state
BULLETTRAIN_GIT_CLEAN"✔"Icon for clean state
BULLETTRAIN_GIT_ADDED"%F{green}✚%F{black}"Icon for added files on stage
BULLETTRAIN_GIT_MODIFIED"%F{blue}✹%F{black}"Icon for modified files
BULLETTRAIN_GIT_DELETED"%F{red}✖%F{black}"Icon for delete files on stage
BULLETTRAIN_GIT_UNTRACKED"%F{yellow}✭%F{black}"Icon for untracked files
BULLETTRAIN_GIT_RENAMED"➜"Icon for renamed
BULLETTRAIN_GIT_UNMERGED"═"Icon for unmerged state
BULLETTRAIN_GIT_AHEAD" ⬆"Icon for ahead state from remote
BULLETTRAIN_GIT_BEHIND" ⬇"Icon for behind state from remote
BULLETTRAIN_GIT_DIVERGED" ⬍"Icon for diverged state from remote

The git prompt can be disabled for a specific repository by setting a git config flag: git config oh-my-zsh.hide-status 1. This is useful to avoid performance issues for particularly huge repositories.

Screen

VariableDefaultMeaning
BULLETTRAIN_SCREEN_BGwhiteBackground color
BULLETTRAIN_SCREEN_FGblackForeground color
BULLETTRAIN_SCREEN_PREFIXPrefix of the segment

Mercurial/HG

VariableDefaultMeaning

Command execution time

VariableDefaultMeaning
BULLETTRAIN_EXEC_TIME_ELAPSED5Minimum elapsed time of command execution. If the execution time of a command is smaller than this, the segment will be hidden.
BULLETTRAIN_EXEC_TIME_BGyellowBackground color
BULLETTRAIN_EXEC_TIME_FGblackForeground color

Wiki

Contributors

That project was originally a fork from Powerline, but most of the code was later erased and its now more closely related to Agnoster. Below is a git summary of the project:

156	Caio Gondim
 33	Jérémy Romey
 14	Greg Fitzgerald
  8	Dan Kaplun
  8	Viktor (Icon) VAD
  7	Jocelyn Mallon
  7	Dawid Kurek
  6	Joe Block
  6	Jérémy Romey
  5	Arthur Wang
  4	Flavius Aspra
  3	Mario Zigliotto
  3	Michael Robinson
  3	Michael Cornell
  3	Iulian Onofrei
  2	itsZero (Chien-An Cho)
  2	Daniel Loader
  2	Charlie Smith
  2	wujtruj
  2	Jiri Tyr
  1	Sébastien Bordenave
  1	Yongqian Li
  1	alysson
  1	gvillalta99
  1	illuminatis
  1	krischer
  1	m.kuehn
  1	timfeirg
  1	Adrien Brault
  1	yachi
  1	Andreas Galauner
  1	Dale Davis
  1	Fabio Poloni
  1	Faure Hu
  1	Guillaume BINET
  1	Hannes Frank
  1	Heng-Yi Wu
  1	Jack Chu
  1	Jason Hollis
  1	KVoll
  1	Kevin
  1	Lyncredible
  1	Manuel Hoffmann
  1	Marius Krämer
  1	Maxime Bruguet
  1	Mertcan Mermerkaya
  1	Nicholas
  1	Peter Nagy
  1	Sen Jiang

Credits

This theme is highly inspired by the following themes:

Donating

If you found this project useful and are willing to donate, transfer some bitcoins to 1BqqKiZA8Tq43CdukdBEwCdDD42jxuX9UY or through the URL https://www.coinbase.com/caiogondim

Or via PayPal.me https://www.paypal.me/caiogondim.


caiogondim.com  ·  GitHub @caiogondim  ·  Twitter @caio_gondim