Skip to content

Instantly share code, notes, and snippets.

@nealrs
Created February 9, 2015 14:19
Show Gist options
  • Save nealrs/bfcca5589f4a59e46d45 to your computer and use it in GitHub Desktop.
Save nealrs/bfcca5589f4a59e46d45 to your computer and use it in GitHub Desktop.
my edits to the ys theme for oh-my-zsh
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background and the font Inconsolata.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
#
# http://ysmood.org/wp/2013/03/my-ys-terminal-theme/
# Mar 2013 ys
# Machine name.
function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || hostname -s
}
# Directory info.
local current_dir='${PWD/#$HOME/~}'
# Git info.
local git_info='$(git_prompt_info)'
#ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}["
ZSH_THEME_GIT_PROMPT_PREFIX=" · %{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$terminfo[bold]$fg[red]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$terminfo[bold]$fg[green]%}✓"
# Prompt format: \n DIRECTORY ·[BRANCH STATE] \n ❯
# %{$terminfo[bold]$fg[blue]%}\
# %{$fg[white]%}[%*] \
PROMPT="
%{$terminfo[bold]$fg[green]%}${current_dir}%{$reset_color%}\
${git_info}
%{$terminfo[bold]$fg[magenta]%}❯ \
%{$reset_color%}"
if [[ "$USER" == "root" ]]; then
PROMPT="
%{$terminfo[bold]$fg[blue]%}root%{$reset_color%} \
%{$terminfo[bold]$fg[green]%}${current_dir}%{$reset_color%}\
${git_info}
%{$terminfo[bold]$fg[magenta]%}❯ \
%{$reset_color%}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment