Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
ZSH theme for light background
PROMPT='$(prompt_clr)λ %{$fg[grey]%}%1~ $(prompt_mode) $(git_prompt_info)$(hg_prompt_info)%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%} → %{$reset_color%}"
function hg_prompt_info {
hg prompt --angle-brackets "\
<%{$fg[blue]%}<branch>%{$reset_color%}> \
<%{$fg[blue]%}<status|modified|unknown>%{$reset_color%} >" 2>/dev/null
}
function prompt_clr {
git branch >/dev/null 2>/dev/null && echo "%{$fg[red]%}" && return
hg root >/dev/null 2>/dev/null && echo "%{$fg[blue]%}" && return
echo "%{$fg[black]%}"
}
VIMODE='→'
function zle-line-init zle-keymap-select {
VIMODE="${${KEYMAP/vicmd/:}/(main|viins)/→}"
zle reset-prompt
}
zle -N zle-line-init
zle -N zle-keymap-select
function prompt_mode {
echo "%{$fg[red]%}${VIMODE}"
}
Owner

ferd commented Apr 1, 2014

Dark version:

PROMPT='$(prompt_clr)λ %{$fg[green]%}%1~ $(prompt_mode) $(git_prompt_info)$(hg_prompt_info)%{$reset_color%}'

ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%} → %{$reset_color%}"

function hg_prompt_info {
    hg prompt --angle-brackets "\
<%{$fg[blue]%}<branch>%{$reset_color%}> \
<%{$fg[blue]%}<status|modified|unknown>%{$reset_color%} >" 2>/dev/null
}

function prompt_clr {
    git branch >/dev/null 2>/dev/null && echo "%{$fg[red]%}" && return
    hg root >/dev/null 2>/dev/null && echo "%{$fg[blue]%}" && return
    echo "%{$fg[yellow]%}"
}

VIMODE='→'
function zle-line-init zle-keymap-select {
 VIMODE="${${KEYMAP/vicmd/:}/(main|viins)/→}"
 zle reset-prompt
}

zle -N zle-line-init
zle -N zle-keymap-select

function prompt_mode {
    echo "%{$fg[red]%}${VIMODE}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment