Home

Awesome

<p align="center"> <img src="https://raw.githubusercontent.com/MRZ07/shinkansen.zsh-theme/main/img/shinkansen-icon.png" width="50%" /> </p> <p align="center"> Shinkansen is a fast, customizable and easily expandable terminal theme </p>

Preview

Features

It currently shows:

And much more...

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

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 shinkansen.zsh-theme in $ZSH_CUSTOM/themes/

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

ZSH_THEME="shinkansen"

For antigen users

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

antigen theme https://github.com/MRZ07/shinkansen.zsh-theme shinkansen

For Zgenom users

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

zgenom load mrz07/shinkansen.zsh-theme shinkansen

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 "mrz07/shinkansen.zsh", use:shinkansen.zsh-theme, defer:3 # defer until other plugins like oh-my-zsh is loaded

Options

Shinkansen 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

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

SHINKANSEN_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
SHINKANSEN_PROMPT_CHAR\$Character to be show before any command
SHINKANSEN_PROMPT_ROOTtrueHighlight if running as root
SHINKANSEN_PROMPT_SEPARATE_LINEtrueMake the prompt span across two lines
SHINKANSEN_PROMPT_ADD_NEWLINEtrueAdds a newline character before each prompt line

Status

VariableDefaultMeaning
SHINKANSEN_STATUS_EXIT_SHOWfalseShow/hide exit code of last command
SHINKANSEN_STATUS_BGgreenBackground color
SHINKANSEN_STATUS_ERROR_BGredBackground color of segment when last command exited with an error
SHINKANSEN_STATUS_FGblackForeground color

Time

VariableDefaultMeaning
SHINKANSEN_TIME_12HRfalseFormat time using 12-hour clock (am/pm)
SHINKANSEN_TIME_BGwhiteBackground color
SHINKANSEN_TIME_FGblackForeground color

Custom Message

VariableDefaultMeaning
SHINKANSEN_CUSTOM_MSGfalseFree segment you can put a custom message which will be eval'ed for every prompt
SHINKANSEN_CUSTOM_BGblackBackground color
SHINKANSEN_CUSTOM_FGdefaultForeground color

Context

VariableDefaultMeaning
SHINKANSEN_CONTEXT_BGblackBackground color
SHINKANSEN_CONTEXT_FGdefaultForeground color
SHINKANSEN_CONTEXT_DEFAULT_USERnoneDefault user. If you are running with other user other than default, the segment will be showed.
SHINKANSEN_CONTEXT_HOSTNAME%mHostname. Set %M to display the full qualified domain name.
SHINKANSEN_IS_SSH_CLIENTnoneIf true, the segment will be showed.

Python virtualenv (+Pyenv)

VariableDefaultMeaning
SHINKANSEN_VIRTUALENV_BGyellowBackground color
SHINKANSEN_VIRTUALENV_FGwhiteForeground color
SHINKANSEN_VIRTUALENV_PREFIX🐍Prefix of the segment

node.js

VariableDefaultMeaning
SHINKANSEN_NVM_BGgreenBackground color
SHINKANSEN_NVM_FGwhiteForeground color
SHINKANSEN_NVM_PREFIX"⬡ "Prefix of the segment

Java

VariableDefaultMeaning
SHINKANSEN_JAVA_BGblackBackground color
SHINKANSEN_JAVA_FGredForeground color
SHINKANSEN_JAVA_PREFIX"☕️ "Prefix of the segment

Ruby RVM/Rbenv

VariableDefaultMeaning
SHINKANSEN_RUBY_BGmagentaBackground color
SHINKANSEN_RUBY_FGwhiteForeground color
SHINKANSEN_RUBY_PREFIX"♦"Prefix of the segment

Elixir

VariableDefaultMeaning
SHINKANSEN_ELIXIR_BGmagentaBackground color
SHINKANSEN_ELIXIR_FGwhiteForeground color
SHINKANSEN_ELIXIR_PREFIX"💧"Prefix of the segment

Go

VariableDefaultMeaning
SHINKANSEN_GO_BGgreenBackground color
SHINKANSEN_GO_FGwhiteForeground color
SHINKANSEN_GO_PREFIX🦦Prefix of the segment

Kubernetes Context

VariableDefaultMeaning
SHINKANSEN_KCTX_BGyellowBackground color
SHINKANSEN_KCTX_FGwhiteForeground color
SHINKANSEN_KCTX_PREFIXKubernetes prefix of the segment
SHINKANSEN_KCTX_KUBECTLtrueIf false disable kubectl usage
SHINKANSEN_KCTX_NAMESPACEtrueIf false will not show the default namespace. Namespace is only visible if kubectl is installed
SHINKANSEN_KCTX_KCONFIG${HOME}/.kube/configLocation of kube config file (e.g. /Users/Hugo/.kube/config)

The prompt will first check if SHINKANSEN_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 SHINKANSEN_KCTX_KUBECTL=false or kubectl is not installed, SHINKANSEN_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
SHINKANSEN_AWS_BGyellowBackground color
SHINKANSEN_AWS_FGblackForeground color
SHINKANSEN_AWS_PREFIX☁️Prefix of the segment

Perl

VariableDefaultMeaning
SHINKANSEN_PERL_BGyellowBackground color
SHINKANSEN_PERL_FGblackForeground color
SHINKANSEN_PERL_PREFIX🐪Prefix of the segment

Dir

VariableDefaultMeaning
SHINKANSEN_DIR_BGblueBackground color
SHINKANSEN_DIR_FGwhiteForeground color
SHINKANSEN_DIR_CONTEXT_SHOWfalseShow user and machine in an SCP formatted style
SHINKANSEN_DIR_EXTENDED1Extended path (0=short path, 1=medium path, 2=complete path, everything else=medium path)

Git

VariableDefaultMeaning
SHINKANSEN_GIT_COLORIZE_DIRTYfalseSet SHINKANSEN_GIT_BG to SHINKANSEN_GIT_COLORIZE_DIRTY_COLOR in dirty state
SHINKANSEN_GIT_COLORIZE_DIRTY_BG_COLORyellowSHINKANSEN_GIT_BG in dirty state
SHINKANSEN_GIT_COLORIZE_DIRTY_FG_COLORblackSHINKANSEN_GIT_FG in dirty state
SHINKANSEN_GIT_BGwhiteBackground color
SHINKANSEN_GIT_FGblackForeground color
SHINKANSEN_GIT_PROMPT_CMDgit_prompt_infoFunction to display details about your git segment.
SHINKANSEN_GIT_EXTENDEDtrue
SHINKANSEN_GIT_PREFIX""Prefix
SHINKANSEN_GIT_SUFFIX""Suffix
SHINKANSEN_GIT_DIRTY"✘"Icon for dirty state
SHINKANSEN_GIT_CLEAN"✔"Icon for clean state
SHINKANSEN_GIT_ADDED"%F{green}✚%F{black}"Icon for added files on stage
SHINKANSEN_GIT_MODIFIED"%F{blue}✹%F{black}"Icon for modified files
SHINKANSEN_GIT_DELETED"%F{red}✖%F{black}"Icon for delete files on stage
SHINKANSEN_GIT_UNTRACKED"%F{yellow}✭%F{black}"Icon for untracked files
SHINKANSEN_GIT_RENAMED"➜"Icon for renamed
SHINKANSEN_GIT_UNMERGED"═"Icon for unmerged state
SHINKANSEN_GIT_AHEAD" ⬆"Icon for ahead state from remote
SHINKANSEN_GIT_BEHIND" ⬇"Icon for behind state from remote
SHINKANSEN_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
SHINKANSEN_SCREEN_BGwhiteBackground color
SHINKANSEN_SCREEN_FGblackForeground color
SHINKANSEN_SCREEN_PREFIXPrefix of the segment

Mercurial/HG

Nothing to configure.

Command execution time

VariableDefaultMeaning
SHINKANSEN_EXEC_TIME_ELAPSED5Minimum elapsed time of command execution. If the execution time of a command is smaller than this, the segment will be hidden.
SHINKANSEN_EXEC_TIME_BGyellowBackground color
SHINKANSEN_EXEC_TIME_FGblackForeground color

Contributors & Credits

This project was originally a fork from Bullettrain