Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
zsh theme: muse-lxc
#!/usr/bin/env zsh
# update: 2021-06-05
# source
# https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/muse.zsh-theme
# search all git colors
# grep -o "ZSH_THEME_GIT_[A-Z_]\+" ~/.oh-my-zsh/lib/git.zsh | sort | uniq
# bash color list
# https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
# print 256 colors on terminal
# https://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal
setopt promptsubst
autoload -U add-zsh-hook
local return_code="%(?.%{$FG[119]%}✔.%{$FG[202]%}✘%?)%{$reset_color%}"
local current_path="%{$FG[117]%}%~%{$reset_color%}"
# modify from .oh-my-zsh/lib/git.zsh
function xgit_prompt_info() {
if [[ "$(command git config --get oh-my-zsh.hide-status 2>/dev/null)" != "1" ]]; then
local ref
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
local tagString=`git describe --abbrev=0 --tags 2>/dev/null`
if [ ! -z $tagString ]; then
tagString=" $FG[177]$tagString"
fi
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$tagString$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}
local PROMPT_LINE_1='${return_code} ${current_path} $(xgit_prompt_info)$(git_prompt_status) $(virtualenv_prompt_info)'
local PROMPT_LINE_2='%{$reset_color%}\$ '
PROMPT="${PROMPT_LINE_1}
${PROMPT_LINE_2}"
GIT_PROMPT_INFO=$FG[033]
ZSH_THEME_GIT_PROMPT_PREFIX="%{$GIT_PROMPT_INFO%}("
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%})"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$FG[009]%}*"
#ZSH_THEME_GIT_PROMPT_CLEAN="%{$FG[040]%}✔"
ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[010]%}a%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[166]%}m%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[200]%}d%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[220]%}r%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[051]%}u%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[226]%}?%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_STASHED="%{$FG[214]%}s%{$reset_color%}"
ZSH_THEME_VIRTUALENV_PREFIX=" ["
ZSH_THEME_VIRTUALENV_SUFFIX="]"
@lixingcong

This comment has been minimized.

Copy link
Owner Author

@lixingcong lixingcong commented Sep 17, 2016

太花哨的主题卡,不流畅,选用一个简单的主题

111

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