Skip to content

Instantly share code, notes, and snippets.

@alnjxn
Last active December 17, 2016 20:29
Show Gist options
  • Save alnjxn/c16ab462db89818ab884356e0b582374 to your computer and use it in GitHub Desktop.
Save alnjxn/c16ab462db89818ab884356e0b582374 to your computer and use it in GitHub Desktop.
# alnjxn.zsh-theme
export VIRTUAL_ENV_DISABLE_PROMPT=1
function prompt_char {
git branch >/dev/null 2>/dev/null && echo 'λ' && return
echo 'λ'
}
function venv_info {
[ $VIRTUAL_ENV ] && echo '›'`basename $VIRTUAL_ENV`'‹ '
}
function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || echo $SHORT_HOST || echo $HOST
}
local rvm_ruby='‹$(rbenv version-name)›%{$reset_color%}'
local current_dir='${PWD/#$HOME/~}'
local git_info='$(git_prompt_info)'
local nvm_info='‹node-$(nodenv version-name)›%{$reset_color%}'
local venv_info='$(venv_info)%{$reset_color%}'
PROMPT="%{$fg[cyan]%}%n%{$reset_color%}%{$FG[black]%}@%{$reset_color%}%{$fg[blue]%}$(box_name)%{$reset_color%} %{$FG[black]%}in%{$reset_color%} %{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}${git_info} %{$FG[black]%}using%{$fg[red]%} ${rvm_ruby}%{$FG[black]%}+%{$fg[green]%}${nvm_info} %{$fg[red]%}${venv_info}
$(prompt_char) "
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[black]%}on%{$reset_color%} %{$fg[magenta]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[202]%}✘✘✘"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment