Skip to content

Instantly share code, notes, and snippets.

@rajanand02
Created July 26, 2014 20:06
Show Gist options
  • Save rajanand02/77eb2790d22d9540a482 to your computer and use it in GitHub Desktop.
Save rajanand02/77eb2790d22d9540a482 to your computer and use it in GitHub Desktop.
custom zsh theme
# Machine name.
function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || hostname
}
# Directory info.
local current_dir='${PWD/#$HOME/~}'
# Git info.
local git_info='$(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[white]%}%{$reset_color%}%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✘"
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}cool ✔"
# Prompt format: \n # USER at MACHINE in DIRECTORY on git:BRANCH STATE [TIME] \n $
PROMPT="╭─%
%{$fg[green]%}%n\
%{$fg[cyan]%}@\
%{$fg[green]%}$(box_name) \
%{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\
${git_info} \
%{$fg[green]%}[%*]
%{$terminfo[normal]$fg[white]%}╰─➤$P %{$reset_color%}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment