Skip to content

Instantly share code, notes, and snippets.

@quangtt-rks
Last active September 22, 2017 08:49
Show Gist options
  • Save quangtt-rks/01a0edefc52de317e4b4 to your computer and use it in GitHub Desktop.
Save quangtt-rks/01a0edefc52de317e4b4 to your computer and use it in GitHub Desktop.
Incident theme for Oh-my-zsh
autoload -Uz vcs_info
GREEN="%{$fg_bold[green]%}"
YELLOW="%{$fg_bold[yellow]%}"
CYAN="%{$fg_bold[cyan]%}"
RED="%{$fg_bold[red]%}"
RESET="%{$reset_color%}"
zstyle ':vcs_info:*' stagedstr '%F{green}●'
zstyle ':vcs_info:*' unstagedstr '%F{yellow}●'
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
zstyle ':vcs_info:*' enable git svn
theme_precmd () {
if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
zstyle ':vcs_info:*' formats '  %b%c%u%B%F{green}'
} else {
zstyle ':vcs_info:*' formats '  %b%c%u%B%F{red}●%F{green}'
}
vcs_info
}
setopt prompt_subst
PROMPT='$GREEN⬢ $CYAN%c$GREEN${vcs_info_msg_0_} $RESET'
autoload -U add-zsh-hook
add-zsh-hook precmd theme_precmd
@quangtt-rks
Copy link
Author

quangtt-rks commented Jan 20, 2016

Installation

Just click on Raw for moo.zsh-theme file
Place it in your Oh-my-zsh custome themes (~/.oh-my-zsh/custom/themes) and modify you .zshrc according to these instructions.

On the screenshot, font Source Code Pro for Powerline Semibold, size 10pt; Color built-in XTerm.

Preview

screenshot from 2017-09-22 15-42-47

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