Skip to content

Instantly share code, notes, and snippets.

@freaz
Last active December 23, 2016 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freaz/1b6ab3eddebd5a3e5f26ed4338c977a0 to your computer and use it in GitHub Desktop.
Save freaz/1b6ab3eddebd5a3e5f26ed4338c977a0 to your computer and use it in GitHub Desktop.
My Zsh theme
### GIT
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})%{$reset_color%}"
### NVM
ZSH_THEME_NVM_PROMPT_PREFIX="node:("
ZSH_THEME_NVM_PROMPT_SUFFIX=")"
function nvm_info() {
echo "node:($(node --version | sed -e 's/v//'), $(npm --version))"
}
### RBENV
function ruby_version() {
echo "ruby:($(rbenv version | sed -e "s/ (set.*$//"))"
}
### HEROKU
local heroku_cmd=/usr/local/bin/heroku
function heroku_active_account() {
echo "heroku:($($heroku_cmd accounts | sed -n '/^\*.*/p' | sed -e 's/^\* //'))"
}
function show_datetime() {
echo "%{$fg_bold[green]%}[$(date +%Y-%m-%dT%H:%M:%S)]%{$reset_color%}"
}
PROMPT='$(show_datetime) %{$fg[cyan]%}%c%{$reset_color%}$(git_prompt_info) %B$%b%{$reset_color%} '
RPROMPT='$(nvm_info) $(ruby_version) $(heroku_active_account)'
@freaz
Copy link
Author

freaz commented Sep 30, 2016

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment