Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
aeca2ad8
Commit
aeca2ad8
authored
Feb 21, 2016
by
Yad Smood
Browse files
Optimize the ys.zsh-theme make it more expressive
parent
0d0042aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
themes/ys.zsh-theme
View file @
aeca2ad8
# Clean, simple, compatible and meaningful.
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background
and the font Inconsolata
.
# It is recommended to use with a dark background.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
#
#
# http://ysmood.org/wp/2013/03/my-ys-terminal-theme/
# Mar 2013 Yad Smood
# Mar 2013 ys
# Machine name.
function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || echo $HOST
}
# Directory info.
local current_dir='${PWD/#$HOME/~}'
# VCS
# VCS
YS_VCS_PROMPT_PREFIX1=" %{$fg[white]%}on%{$reset_color%} "
YS_VCS_PROMPT_PREFIX1=" %{$fg[white]%}on%{$reset_color%} "
...
@@ -21,7 +12,7 @@ YS_VCS_PROMPT_SUFFIX="%{$reset_color%}"
...
@@ -21,7 +12,7 @@ YS_VCS_PROMPT_SUFFIX="%{$reset_color%}"
YS_VCS_PROMPT_DIRTY=" %{$fg[red]%}x"
YS_VCS_PROMPT_DIRTY=" %{$fg[red]%}x"
YS_VCS_PROMPT_CLEAN=" %{$fg[green]%}o"
YS_VCS_PROMPT_CLEAN=" %{$fg[green]%}o"
# Git info
.
# Git info
local git_info='$(git_prompt_info)'
local git_info='$(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="${YS_VCS_PROMPT_PREFIX1}git${YS_VCS_PROMPT_PREFIX2}"
ZSH_THEME_GIT_PROMPT_PREFIX="${YS_VCS_PROMPT_PREFIX1}git${YS_VCS_PROMPT_PREFIX2}"
ZSH_THEME_GIT_PROMPT_SUFFIX="$YS_VCS_PROMPT_SUFFIX"
ZSH_THEME_GIT_PROMPT_SUFFIX="$YS_VCS_PROMPT_SUFFIX"
...
@@ -44,29 +35,24 @@ ys_hg_prompt_info() {
...
@@ -44,29 +35,24 @@ ys_hg_prompt_info() {
fi
fi
}
}
# Prompt format: \n # USER at MACHINE in DIRECTORY on git:BRANCH STATE [TIME] \n $
PROMPT="
%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
%{$fg[cyan]%}%n \
%{$fg[white]%}at \
%{$fg[green]%}$(box_name) \
%{$fg[white]%}in \
%{$terminfo[bold]$fg[yellow]%}${current_dir}%{$reset_color%}\
${hg_info}\
${git_info} \
%{$fg[white]%}[%*]
%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
if [[ "$USER" == "root" ]]; then
# Prompt format:
#
# PRIVILEGES USER @ MACHINE in DIRECTORY on git:BRANCH STATE [TIME] L:SHELL_LEVEL N:LINE_NUM
# $ COMMAND
#
# For example:
#
# % ys @ ys-mbp in ~/.oh-my-zsh on git:master x [21:47:42] tty:s000 L:1 N:12
# $
PROMPT="
PROMPT="
%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
%{$terminfo[bold]$fg[blue]%}#%{$reset_color%} \
%{$bg[yellow]%}%{$fg[
cyan
]%}%n%{$reset_color%} \
%(#,
%{$bg[yellow]%}%{$fg[
black
]%}%n%{$reset_color%}
,%{$fg[cyan]%}%n)
\
%{$fg[white]%}
at
\
%{$fg[white]%}
@
\
%{$fg[green]%}
$(box_name)
\
%{$fg[green]%}
%m
\
%{$fg[white]%}in \
%{$fg[white]%}in \
%{$terminfo[bold]$fg[yellow]%}
${current_dir}
%{$reset_color%}\
%{$terminfo[bold]$fg[yellow]%}
%~
%{$reset_color%}\
${hg_info}\
${hg_info}\
${git_info} \
${git_info} \
%{$fg[white]%}[%*]
%{$fg[white]%}[%*]
tty:%l L:%L N:%i
%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
%{$terminfo[bold]$fg[red]%}$ %{$reset_color%}"
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment