Created
March 18, 2018 07:06
-
-
Save cycold/c047158235b1bd48caae81ec3b58d791 to your computer and use it in GitHub Desktop.
iterm2 oh-my-zsh thems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.0</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.0</real> | |
<key>Red Component</key> | |
<real>0.0</real> | |
</dict> | |
<key>Ansi 1 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.21176470816135406</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.26274511218070984</real> | |
<key>Red Component</key> | |
<real>0.95686274766921997</real> | |
</dict> | |
<key>Ansi 10 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.55492770671844482</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.96675270795822144</real> | |
<key>Red Component</key> | |
<real>0.35246825218200684</real> | |
</dict> | |
<key>Ansi 11 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.61633026599884033</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.9747205376625061</real> | |
<key>Red Component</key> | |
<real>0.95514363050460815</real> | |
</dict> | |
<key>Ansi 12 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>1</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.29621437191963196</real> | |
<key>Red Component</key> | |
<real>0.16078431904315948</real> | |
</dict> | |
<key>Ansi 13 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.69586181640625</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.2413579523563385</real> | |
<key>Red Component</key> | |
<real>0.62982279062271118</real> | |
</dict> | |
<key>Ansi 14 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.99438935518264771</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.92829710245132446</real> | |
<key>Red Component</key> | |
<real>0.60349732637405396</real> | |
</dict> | |
<key>Ansi 15 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.961212158203125</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.961212158203125</real> | |
<key>Red Component</key> | |
<real>0.93137961626052856</real> | |
</dict> | |
<key>Ansi 2 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.55492770671844482</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.96675270795822144</real> | |
<key>Red Component</key> | |
<real>0.35246825218200684</real> | |
</dict> | |
<key>Ansi 3 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.61633026599884033</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.9747205376625061</real> | |
<key>Red Component</key> | |
<real>0.95514363050460815</real> | |
</dict> | |
<key>Ansi 4 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>1</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.47450980544090271</real> | |
<key>Red Component</key> | |
<real>0.16078431904315948</real> | |
</dict> | |
<key>Ansi 5 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.73725491762161255</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.27843138575553894</real> | |
<key>Red Component</key> | |
<real>0.67058825492858887</real> | |
</dict> | |
<key>Ansi 6 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.99438935518264771</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.92829710245132446</real> | |
<key>Red Component</key> | |
<real>0.60349732637405396</real> | |
</dict> | |
<key>Ansi 7 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>1</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>1</real> | |
<key>Red Component</key> | |
<real>0.93333333730697632</real> | |
</dict> | |
<key>Ansi 8 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.4078223705291748</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.40782788395881653</real> | |
<key>Red Component</key> | |
<real>0.40781760215759277</real> | |
</dict> | |
<key>Ansi 9 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.15361772477626801</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.20690515637397766</real> | |
<key>Red Component</key> | |
<real>0.93243408203125</real> | |
</dict> | |
<key>Background Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.21176472306251526</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.16470587253570557</real> | |
<key>Red Component</key> | |
<real>0.15686270594596863</real> | |
</dict> | |
<key>Badge Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>0.5</real> | |
<key>Blue Component</key> | |
<real>0.0</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.1491314172744751</real> | |
<key>Red Component</key> | |
<real>1</real> | |
</dict> | |
<key>Bold Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>1</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>1</real> | |
<key>Red Component</key> | |
<real>0.99999600648880005</real> | |
</dict> | |
<key>Cursor Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.78104829788208008</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.78105825185775757</real> | |
<key>Red Component</key> | |
<real>0.7810397744178772</real> | |
</dict> | |
<key>Cursor Guide Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>0.25</real> | |
<key>Blue Component</key> | |
<real>1</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.9268307089805603</real> | |
<key>Red Component</key> | |
<real>0.70213186740875244</real> | |
</dict> | |
<key>Cursor Text Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>1</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>1</real> | |
<key>Red Component</key> | |
<real>0.99999600648880005</real> | |
</dict> | |
<key>Foreground Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.95934468507766724</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.97761756181716919</real> | |
<key>Red Component</key> | |
<real>0.9781760573387146</real> | |
</dict> | |
<key>Link Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.73423302173614502</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.35916060209274292</real> | |
<key>Red Component</key> | |
<real>0.0</real> | |
</dict> | |
<key>Selected Text Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>1</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>1</real> | |
<key>Red Component</key> | |
<real>0.99999600648880005</real> | |
</dict> | |
<key>Selection Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.42833542823791504</real> | |
<key>Color Space</key> | |
<string>sRGB</string> | |
<key>Green Component</key> | |
<real>0.35205566883087158</real> | |
<key>Red Component</key> | |
<real>0.3362850546836853</real> | |
</dict> | |
</dict> | |
</plist> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Zeta theme for oh-my-zsh | |
# Tested on Linux, Unix and Windows under ANSI colors. | |
# Copyright: Skyler Lee, 2015 | |
# Colors: black|red|blue|green|yellow|magenta|cyan|white | |
local black=$fg[black] | |
local red=$fg[red] | |
local blue=$fg[blue] | |
local green=$fg[green] | |
local yellow=$fg[yellow] | |
local magenta=$fg[magenta] | |
local cyan=$fg[cyan] | |
local white=$fg[white] | |
local black_bold=$fg_bold[black] | |
local red_bold=$fg_bold[red] | |
local blue_bold=$fg_bold[blue] | |
local green_bold=$fg_bold[green] | |
local yellow_bold=$fg_bold[yellow] | |
local magenta_bold=$fg_bold[magenta] | |
local cyan_bold=$fg_bold[cyan] | |
local white_bold=$fg_bold[white] | |
local highlight_bg=$bg[red] | |
local zeta='λ' | |
# Machine name. | |
function get_box_name { | |
if [ -f ~/.box-name ]; then | |
cat ~/.box-name | |
else | |
echo $HOST | |
fi | |
} | |
# User name. | |
function get_usr_name { | |
local name="%n" | |
if [[ "$USER" == 'root' ]]; then | |
name="%{$highlight_bg%}%{$white_bold%}$name%{$reset_color%}" | |
fi | |
echo $name | |
} | |
# Directory info. | |
function get_current_dir { | |
echo "${PWD/#$HOME/~}" | |
} | |
# Git info. | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$yellow%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$green_bold%} ✔ " | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$red_bold%} ✘ " | |
# Git status. | |
ZSH_THEME_GIT_PROMPT_ADDED="%{$green_bold%}+" | |
ZSH_THEME_GIT_PROMPT_DELETED="%{$red_bold%}-" | |
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$magenta_bold%}*" | |
ZSH_THEME_GIT_PROMPT_RENAMED="%{$blue_bold%}>" | |
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$cyan_bold%}=" | |
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$yellow_bold%}?" | |
# Git sha. | |
ZSH_THEME_GIT_PROMPT_SHA_BEFORE="[%{$yellow%}" | |
ZSH_THEME_GIT_PROMPT_SHA_AFTER="%{$reset_color%}]" | |
function get_git_prompt { | |
if [[ -n $(git rev-parse --is-inside-work-tree 2>/dev/null) ]]; then | |
local git_status="$(git_prompt_status)" | |
if [[ -n $git_status ]]; then | |
git_status="[$git_status%{$reset_color%}]" | |
fi | |
local git_prompt=" <$(git_prompt_info)$git_status>" | |
echo $git_prompt | |
fi | |
} | |
function get_time_stamp { | |
echo "%*" | |
} | |
function get_space { | |
local str=$1$2 | |
local zero='%([BSUbfksu]|([FB]|){*})' | |
local len=${#${(S%%)str//$~zero/}} | |
local size=$(( $COLUMNS - $len - 1 )) | |
local space="" | |
while [[ $size -gt 0 ]]; do | |
space="$space " | |
let size=$size-1 | |
done | |
echo $space | |
} | |
# 换行: https://unix.stackexchange.com/questions/53789/whats-the-newline-symbol-in-zshs-ps1 | |
# Prompt: # USER@MACHINE: DIRECTORY <BRANCH [STATUS]> --- (TIME_STAMP) | |
# > command | |
function print_prompt_head { | |
local left_prompt="\ | |
%{$cyan%}$(get_current_dir)%{$reset_color%}\ | |
$(get_git_prompt) " | |
local right_prompt="%{$blue%}($(get_time_stamp))%{$reset_color%} " | |
print -rP "$left_prompt$(get_space $left_prompt $right_prompt)$right_prompt" | |
} | |
function get_prompt_indicator { | |
if [[ $? -eq 0 ]]; then | |
echo "%{$magenta_bold%}$zeta %{$reset_color%}" | |
else | |
echo "%{$red_bold%}$zeta %{$reset_color%}" | |
fi | |
} | |
autoload -U add-zsh-hook | |
add-zsh-hook precmd print_prompt_head | |
setopt prompt_subst | |
PROMPT='$(get_prompt_indicator)' | |
RPROMPT='$(git_prompt_short_sha) ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment