• Stars
    star
    2,802
  • Rank 15,605 (Top 0.4 %)
  • Language Makefile
  • License
    MIT License
  • Created almost 10 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿš„ An oh-my-zsh shell theme based on the Powerline Vim plugin

Bullet Train for oh-my-zsh

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:

  • Current Python virtualenv; when using Pyenv and no active virtualenv shows the current Python version the shell uses
  • Current Ruby version using chruby; version and gemset when on RVM or Rbenv
  • Current Node.js version, through NVM (if present) or Node.js
  • Current Perl version using plenv
  • Current Elixir version
  • Git status
  • Timestamp
  • Current directory
  • Background jobs
  • Exit code of last command

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:

  • Powerline compatible fonts like Vim Powerline patched fonts, Input Mono or Monoid.
  • On Ubuntu like systems you'll need the ttf-ancient-fonts package to correctly display some unicode symbols that are not covered by the Powerline fonts above.
  • A ZSH framework like antigen, oh-my-zsh or zgen
  • Make sure terminal is using 256-colors mode with export TERM="xterm-256color"
  • For iTerm 2 users, make sure you go into your settings and set both the regular font and the non-ascii font to powerline compatible fonts or the prompt separators and special characters will not display correctly.

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

Variable Default Meaning
BULLETTRAIN_PROMPT_CHAR \$ Character to be show before any command
BULLETTRAIN_PROMPT_ROOT true Highlight if running as root
BULLETTRAIN_PROMPT_SEPARATE_LINE true Make the prompt span across two lines
BULLETTRAIN_PROMPT_ADD_NEWLINE true Adds a newline character before each prompt line

Status

Variable Default Meaning
BULLETTRAIN_STATUS_EXIT_SHOW false Show/hide exit code of last command
BULLETTRAIN_STATUS_BG green Background color
BULLETTRAIN_STATUS_ERROR_BG red Background color of segment when last command exited with an error
BULLETTRAIN_STATUS_FG black Foreground color

Time

Variable Default Meaning
BULLETTRAIN_TIME_12HR false Format time using 12-hour clock (am/pm)
BULLETTRAIN_TIME_BG white Background color
BULLETTRAIN_TIME_FG black Foreground color

Custom

Variable Default Meaning
BULLETTRAIN_CUSTOM_MSG false Free segment you can put a custom message which will be eval'ed for every prompt
BULLETTRAIN_CUSTOM_BG black Background color
BULLETTRAIN_CUSTOM_FG default Foreground color

Context

Variable Default Meaning
BULLETTRAIN_CONTEXT_BG black Background color
BULLETTRAIN_CONTEXT_FG default Foreground color
BULLETTRAIN_CONTEXT_DEFAULT_USER none Default user. If you are running with other user other than default, the segment will be showed.
BULLETTRAIN_CONTEXT_HOSTNAME %m Hostname. Set %M to display the full qualified domain name.
BULLETTRAIN_IS_SSH_CLIENT none If true, the segment will be showed.

Python virtualenv (+Pyenv)

Variable Default Meaning
BULLETTRAIN_VIRTUALENV_BG yellow Background color
BULLETTRAIN_VIRTUALENV_FG white Foreground color
BULLETTRAIN_VIRTUALENV_PREFIX ๐Ÿ Prefix of the segment

node.js nvm

Variable Default Meaning
BULLETTRAIN_NVM_BG green Background color
BULLETTRAIN_NVM_FG white Foreground color
BULLETTRAIN_NVM_PREFIX "โฌก " Prefix of the segment

Ruby RVM/Rbenv

Variable Default Meaning
BULLETTRAIN_RUBY_BG magenta Background color
BULLETTRAIN_RUBY_FG white Foreground color
BULLETTRAIN_RUBY_PREFIX "โ™ฆ" Prefix of the segment

Elixir

Variable Default Meaning
BULLETTRAIN_ELIXIR_BG magenta Background color
BULLETTRAIN_ELIXIR_FG white Foreground color
BULLETTRAIN_ELIXIR_PREFIX "๐Ÿ’ง" Prefix of the segment

Go

Variable Default Meaning
BULLETTRAIN_GO_BG green Background color
BULLETTRAIN_GO_FG white Foreground color
BULLETTRAIN_GO_PREFIX go Prefix of the segment

Kubernetes Context

Variable Default Meaning
BULLETTRAIN_KCTX_BG yellow Background color
BULLETTRAIN_KCTX_FG white Foreground color
BULLETTRAIN_KCTX_PREFIX โŽˆ Kubernetes prefix of the segment
BULLETTRAIN_KCTX_KUBECTL true If false disable kubectl usage
BULLETTRAIN_KCTX_NAMESPACE true If false will not show the default namespace. Namespace is only visible if kubectl is installed
BULLETTRAIN_KCTX_KCONFIG ${HOME}/.kube/config Location 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.

Variable Default Meaning
BULLETTRAIN_AWS_BG yellow Background color
BULLETTRAIN_AWS_FG black Foreground color
BULLETTRAIN_AWS_PREFIX โ˜๏ธ Prefix of the segment

Perl

Variable Default Meaning
BULLETTRAIN_PERL_BG yellow Background color
BULLETTRAIN_PERL_FG black Foreground color
BULLETTRAIN_PERL_PREFIX ๐Ÿช Prefix of the segment

Dir

Variable Default Meaning
BULLETTRAIN_DIR_BG blue Background color
BULLETTRAIN_DIR_FG white Foreground color
BULLETTRAIN_DIR_CONTEXT_SHOW false Show user and machine in an SCP formatted style
BULLETTRAIN_DIR_EXTENDED 1 Extended path (0=short path, 1=medium path, 2=complete path, everything else=medium path)

Git

Variable Default Meaning
BULLETTRAIN_GIT_COLORIZE_DIRTY false Set BULLETTRAIN_GIT_BG to BULLETTRAIN_GIT_COLORIZE_DIRTY_COLOR in dirty state
BULLETTRAIN_GIT_COLORIZE_DIRTY_BG_COLOR yellow BULLETTRAIN_GIT_BG in dirty state
BULLETTRAIN_GIT_COLORIZE_DIRTY_FG_COLOR black BULLETTRAIN_GIT_FG in dirty state
BULLETTRAIN_GIT_BG white Background color
BULLETTRAIN_GIT_FG black Foreground color
BULLETTRAIN_GIT_PROMPT_CMD git_prompt_info Function to display details about your git segment.
BULLETTRAIN_GIT_EXTENDED true
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

Variable Default Meaning
BULLETTRAIN_SCREEN_BG white Background color
BULLETTRAIN_SCREEN_FG black Foreground color
BULLETTRAIN_SCREEN_PREFIX โฌ— Prefix of the segment

Mercurial/HG

Variable Default Meaning

Command execution time

Variable Default Meaning
BULLETTRAIN_EXEC_TIME_ELAPSED 5 Minimum elapsed time of command execution. If the execution time of a command is smaller than this, the segment will be hidden.
BULLETTRAIN_EXEC_TIME_BG yellow Background color
BULLETTRAIN_EXEC_TIME_FG black Foreground 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

More Repositories

1

fast-memoize.js

๐Ÿ‡ Fastest possible memoization library
JavaScript
2,575
star
2

logdown.js

โœ๏ธ Debug utility with markdown support that runs on browser and server
JavaScript
1,024
star
3

maglev

๐Ÿš A Tmux theme made to work together with bullet-train.zsh
Shell
454
star
4

js-patterns-sublime-snippets

๐ŸŽ“ JavaScript Patterns snippets for Sublime Text
CoffeeScript
343
star
5

blooming-menu.js

๐ŸŒธ AwesomeMenu made with CSS
JavaScript
288
star
6

webpack-conditional-loader

C conditionals directive for JavaScript
JavaScript
108
star
7

tubo.js

๐Ÿ„ Your functional (sync/async) pipe | operator
JavaScript
72
star
8

superstylin

Enta in de dance, plug it in and we begin.
HTML
71
star
9

js-console-sublime-snippets

๐Ÿ’ป JavaScript and CoffeeScript Console snippets
CoffeeScript
61
star
10

video-stream.js

๐Ÿ”œ ๐Ÿ“ผ Video stream middleware for express.js
JavaScript
43
star
11

js-konami-code-event

Konami code event for your HTML5 web app/page
JavaScript
40
star
12

alfred-chrome-window-workflow

Alfred.app workflow for creating new Chrome windows
AppleScript
37
star
13

jasmine-sublime-snippets

Snippets for Jasmine, the BDD framework for testing JavaScript, in Sublime Text
Python
35
star
14

monocle-decorators.js

๐ŸŽฉ Classy decorators
JavaScript
32
star
15

chrome-blank-new-tab

Dark blank new tab extension for Chrome.
HTML
30
star
16

keynote-grid

A grid template for Keynote.app
30
star
17

piao-da-casa-propria-em-css-3d

Piรฃo da Casa Prรณpria 100% em HTML5
HTML
28
star
18

safe-chain.js

๐Ÿ”— No more crazy checks to safely get a nested value inside an object
JavaScript
21
star
19

laughing-man.js

JavaScript
21
star
20

redux-whenever.js

๐Ÿ•Ÿ Redux store subscriber for specific state change
JavaScript
21
star
21

parse-price.js

๐Ÿ’ต Returns a Number from a localized price string.
JavaScript
21
star
22

alfred-iterm-workflow

Alfred.app workflow for iTerm2
AppleScript
18
star
23

javascript-environments-logos

PostScript
15
star
24

html-style-guide

13
star
25

hide-virtual-keyboard.js

๐Ÿ“ฑ Hides virtual keyboard on a real mobile device (iPhone, Android, ...)
JavaScript
12
star
26

ken-burns-slideshow

๐ŸŽ‡ A slideshow in JS with the Ken Burns effect.
JavaScript
12
star
27

knowledge

๐Ÿ“– Tips and tricks I learned along the way
12
star
28

js-debounce-throttle-visual-explanation

A visual explanation about the *Throttle* and *Debounce* design patterns
JavaScript
11
star
29

alfred-credit-card-numbers

Credit card fake numbers workflow for Alfred.app
Python
8
star
30

redux-logdown.js

Redux logging middleware
JavaScript
8
star
31

alfred-feline-theme

An OS X-like theme for Alfred
8
star
32

stubbable-decorator.js

๐ŸŒฒ Decorator to stub modules in ECMAScript 2015+
JavaScript
8
star
33

obstructed.js

๐Ÿš Checks if the main thread is busy, executing a callback whenever it happens
JavaScript
7
star
34

with-subscribe.js

Minimal Observable interface to watch for object modifications.
JavaScript
7
star
35

logdown-cast.js

๐Ÿ“ก Subscribe to a remote logdown instance
JavaScript
6
star
36

city-state.js

๐Ÿ‘‘ Observable and encapsulated state management
JavaScript
6
star
37

times-square

Color scheme
JavaScript
6
star
38

caiogondim.com

๐Ÿ“ where i write about random things, at random times
JavaScript
6
star
39

timeout-racer.js

๐ŸŽ๏ธ Timeout for promises race
JavaScript
5
star
40

simopen

๐Ÿ“ฑ Opens given URL on iOS simulator.
JavaScript
5
star
41

quickreturn.js

:squirrel: QuickReturn Android pattern to the web
JavaScript
5
star
42

jquery-first-event

๐Ÿ† Execute your event listener callback before others
JavaScript
5
star
43

css3-lightbulb-with-ambient-light-sensor

a light bulb in CSS3 with ambient light awareness
CSS
4
star
44

hourglass.js

โง—
JavaScript
4
star
45

js-underscore.tmbundle

A TextMate bundle for the JavaScript Underscore library
4
star
46

react-with-dimensions

โš›๏ธ React decorator to receive dimensions props generated by ResizeObserver.
JavaScript
4
star
47

solar-system

A solar system entirely built with <canvas> and no external libs
JavaScript
4
star
48

arg-type.js

Like prop-types, but for vanilla JavaScript
JavaScript
4
star
49

programming-challenges

Rust
3
star
50

alfred-sublime-text-window-workflow

A workflow to create Sublime Text windows without having to be in it's context.
AppleScript
3
star
51

resilient.js

Resilient JS loader
JavaScript
3
star
52

docker-node-puppeteer

Dockerfile
3
star
53

gridlock.css

๐Ÿš™ ๐Ÿš— Small CSS grid layout implemented with flexbox
HTML
3
star
54

corleone.js

DOM utilities
JavaScript
3
star
55

idle-promise.js

requestIdleCallback with a Promise interface and setTimeout fallback
JavaScript
2
star
56

murmurhash-wasm

2
star
57

js-style-guide

A remix of everybody's JavaScript style guide
JavaScript
2
star
58

sieve-of-eratosthenes-rust

Rust
2
star
59

signalhub-server.js

2
star
60

observable.js

Minimal Observable interface
2
star
61

alfred-firefox-window-workflow

new Firefox window workflow for Alfred.app
AppleScript
2
star
62

webpix

Um experimento HTML5 com cรขmera, canvas e download sem back-end
JavaScript
2
star
63

css-transform-interactive

Learn CSS transform in a more interactive and fun way
CSS
2
star
64

dotfiles

โšช My dotfiles
Lua
2
star
65

gulp-filename-hint

Gulp plugin for linting filenames
JavaScript
2
star
66

strict-dict.js

Object (dictionary) that throws TypeError when trying to get an undefined property.
JavaScript
2
star
67

msleep

โ›” Small function that mimics the usleep C function, blocking the main thread
JavaScript
1
star
68

white-lion

A Growl Theme based on OS X Lion
1
star
69

css-style-guide

1
star
70

get-highest-z-index.js

JavaScript
1
star
71

strip-margin.js

JavaScript
1
star
72

tip-calculator

HTML
1
star
73

async-preload-img

Promise based image preloader
JavaScript
1
star
74

react-prefetchable

JavaScript
1
star
75

hal

JavaScript
1
star
76

mouse-polling-rate

HTML
1
star
77

sale.caiogondim.com

I'm moving to New York and selling all my stuff for a reasonable price.
HTML
1
star
78

eslint-direct-children-dependency

1
star
79

set-state-redux.js

Love and setState is all you need
JavaScript
1
star
80

invoke-without-new.js

Invoke constructors without new
JavaScript
1
star
81

type-from.js

Get type from given argument
JavaScript
1
star
82

advent-of-code-2022

1
star
83

streams

repository hosting test streams used by hls.js
1
star
84

alfred-itunes-playback-workflow

An Aflred.app workflow to control repeat and shuffle in iTunes
AppleScript
1
star