-
-
Save necocen/e0fb36136f565b085a2d to your computer and use it in GitHub Desktop.
oh-my-zsh用のテーマファイル。自分好みのがなかったのでysとfishyをベースに自作。
This file contains 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
# Based on ys(http://ysmood.org/wp/2013/03/my-ys-terminal-theme/) and fishy. | |
# Modified by necocen. | |
# Machine name. | |
function box_name { | |
[ -f ~/.box-name ] && cat ~/.box-name || hostname -s | |
} | |
# git info+sha+status | |
function git_prompt_info_sha_status() { | |
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \ | |
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return | |
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty) $(git_prompt_short_sha)$(git_prompt_status)$ZSH_THEME_GIT_PROMPT_SUFFIX" | |
} | |
# Prompt format: \n # USER@MACHINE DIRECTORY [BRANCH SHA STATE] [DATE TIME] \n $ | |
PROMPT=' | |
%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \ | |
%{$fg[cyan]%}%n\ | |
%{$fg[white]%}@\ | |
%{$fg[green]%}$(box_name)\ | |
%{$fg[white]%} \ | |
%{$fg[yellow]%}%~%{$reset_color%} \ | |
$(git_prompt_info_sha_status)%{$reset_color%}\ | |
%{$fg[white]%}[%{$fg[white]%}%D{%F %T}%{$fg[white]%}] | |
%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}' | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[white]%}[%{$fg[red]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[white]%}]%{$reset_color%} " | |
ZSH_THEME_GIT_PROMPT_DIRTY="" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" | |
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+" | |
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}!" | |
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}-" | |
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}>" | |
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}#" | |
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
スクリーン・ショット: http://gyazo.com/e8ef633125f0d737ee2648ad99a56d97