Commit 18ef1ee6 authored by Dawid Ferenczy's avatar Dawid Ferenczy
Browse files

Merge remote-tracking branch 'robbyrussell/master'

parents eafd5f32 192de6bc
...@@ -13,7 +13,7 @@ patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset ...@@ -13,7 +13,7 @@ patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset
} }
function box_name { function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || hostname -s [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
} }
PROMPT=' PROMPT='
......
...@@ -21,7 +21,7 @@ local user="%(!.%{$fg[blue]%}.%{$fg[blue]%})%n%{$reset_color%}" ...@@ -21,7 +21,7 @@ local user="%(!.%{$fg[blue]%}.%{$fg[blue]%})%n%{$reset_color%}"
# Hostname part. compressed and colorcoded per host_repr array # Hostname part. compressed and colorcoded per host_repr array
# if not found, regular hostname in default color # if not found, regular hostname in default color
local host="@${host_repr[$(hostname)]:-$(hostname)}%{$reset_color%}" local host="@${host_repr[$HOST]:-$HOST}%{$reset_color%}"
# Compacted $PWD # Compacted $PWD
local pwd="%{$fg[blue]%}%c%{$reset_color%}" local pwd="%{$fg[blue]%}%c%{$reset_color%}"
......
...@@ -21,7 +21,7 @@ function prompt_char { ...@@ -21,7 +21,7 @@ function prompt_char {
} }
function box_name { function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || hostname -s [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
} }
......
...@@ -17,7 +17,7 @@ function prompt_char { ...@@ -17,7 +17,7 @@ function prompt_char {
} }
function box_name { function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || hostname -s [ -f ~/.box-name ] && cat ~/.box-name || echo ${SHORT_HOST:-$HOST}
} }
local ruby_env='' local ruby_env=''
...@@ -35,7 +35,7 @@ local prompt_char='$(prompt_char)' ...@@ -35,7 +35,7 @@ local prompt_char='$(prompt_char)'
PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%}${ruby_env} PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}using%{$FG[243]%}${ruby_env}
╰─${prompt_char} " ╰─${prompt_char}%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
......
if [ "$(whoami)" = "root" ] if [ "$USER" = "root" ]
then CARETCOLOR="red" then CARETCOLOR="red"
else CARETCOLOR="blue" else CARETCOLOR="blue"
fi fi
......
...@@ -11,19 +11,11 @@ git_custom_status() { ...@@ -11,19 +11,11 @@ git_custom_status() {
fi fi
} }
#RVM and git settings # RVM component of prompt
if [[ -s ~/.rvm/scripts/rvm ]] ; then ZSH_THEME_RVM_PROMPT_PREFIX="%{$fg[red]%}["
RPS1='$(git_custom_status)%{$fg[red]%}[`~/.rvm/bin/rvm-prompt`]%{$reset_color%} $EPS1' ZSH_THEME_RVM_PROMPT_SUFFIX="]%{$reset_color%}"
else
if which rbenv &> /dev/null; then # Combine it all into a final right-side prompt
RPS1='$(git_custom_status)%{$fg[red]%}[`rbenv version | sed -e "s/ (set.*$//"`]%{$reset_color%} $EPS1' RPS1='$(git_custom_status)$(ruby_prompt_info) $EPS1'
else
if [[ -n `which chruby_prompt_info` && -n `chruby_prompt_info` ]]; then
RPS1='$(git_custom_status)%{$fg[red]%}[`chruby_prompt_info`]%{$reset_color%} $EPS1'
else
RPS1='$(git_custom_status) $EPS1'
fi
fi
fi
PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b ' PROMPT='%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b '
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
# Based on bira theme # Based on bira theme
# load some modules # load some modules
autoload -U colors zsh/terminfo # Used in the colour alias below autoload -U zsh/terminfo # Used in the colour alias below
colors
setopt prompt_subst setopt prompt_subst
# make some aliases for the colours: (could use normal escape sequences too) # make some aliases for the colours: (could use normal escape sequences too)
...@@ -14,11 +13,11 @@ eval PR_NO_COLOR="%{$terminfo[sgr0]%}" ...@@ -14,11 +13,11 @@ eval PR_NO_COLOR="%{$terminfo[sgr0]%}"
eval PR_BOLD="%{$terminfo[bold]%}" eval PR_BOLD="%{$terminfo[bold]%}"
# Check the UID # Check the UID
if [[ $UID -ge 1000 ]]; then # normal user if [[ $UID -ne 0 ]]; then # normal user
eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}' eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}'
eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}' eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}'
local PR_PROMPT='$PR_NO_COLOR➤ $PR_NO_COLOR' local PR_PROMPT='$PR_NO_COLOR➤ $PR_NO_COLOR'
elif [[ $UID -eq 0 ]]; then # root else # root
eval PR_USER='${PR_RED}%n${PR_NO_COLOR}' eval PR_USER='${PR_RED}%n${PR_NO_COLOR}'
eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}' eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}'
local PR_PROMPT='$PR_RED➤ $PR_NO_COLOR' local PR_PROMPT='$PR_RED➤ $PR_NO_COLOR'
......
...@@ -13,8 +13,6 @@ function virtualenv_info { ...@@ -13,8 +13,6 @@ function virtualenv_info {
PR_GIT_UPDATE=1 PR_GIT_UPDATE=1
setopt prompt_subst setopt prompt_subst
autoload colors
colors
autoload -U add-zsh-hook autoload -U add-zsh-hook
autoload -Uz vcs_info autoload -Uz vcs_info
...@@ -51,8 +49,8 @@ zstyle ':vcs_info:*:prompt:*' check-for-changes true ...@@ -51,8 +49,8 @@ zstyle ':vcs_info:*:prompt:*' check-for-changes true
PR_RST="%{${reset_color}%}" PR_RST="%{${reset_color}%}"
FMT_BRANCH=" on %{$turquoise%}%b%u%c${PR_RST}" FMT_BRANCH=" on %{$turquoise%}%b%u%c${PR_RST}"
FMT_ACTION=" performing a %{$limegreen%}%a${PR_RST}" FMT_ACTION=" performing a %{$limegreen%}%a${PR_RST}"
FMT_UNSTAGED="%{$orange%}●" FMT_UNSTAGED="%{$orange%} ●"
FMT_STAGED="%{$limegreen%}●" FMT_STAGED="%{$limegreen%} ●"
zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}" zstyle ':vcs_info:*:prompt:*' unstagedstr "${FMT_UNSTAGED}"
zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}" zstyle ':vcs_info:*:prompt:*' stagedstr "${FMT_STAGED}"
...@@ -83,7 +81,7 @@ function steeef_precmd { ...@@ -83,7 +81,7 @@ function steeef_precmd {
# check for untracked files or updated submodules, since vcs_info doesn't # check for untracked files or updated submodules, since vcs_info doesn't
if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
PR_GIT_UPDATE=1 PR_GIT_UPDATE=1
FMT_BRANCH="${PM_RST} on %{$turquoise%}%b%u%c%{$hotpink%}●${PR_RST}" FMT_BRANCH="${PM_RST} on %{$turquoise%}%b%u%c%{$hotpink%} ●${PR_RST}"
else else
FMT_BRANCH="${PM_RST} on %{$turquoise%}%b%u%c${PR_RST}" FMT_BRANCH="${PM_RST} on %{$turquoise%}%b%u%c${PR_RST}"
fi fi
...@@ -95,5 +93,4 @@ function steeef_precmd { ...@@ -95,5 +93,4 @@ function steeef_precmd {
} }
add-zsh-hook precmd steeef_precmd add-zsh-hook precmd steeef_precmd
PROMPT=$' PROMPT=$'%{$purple%}%n%{$reset_color%} in %{$limegreen%}%~%{$reset_color%}$(ruby_prompt_info " with%{$fg[red]%} " v g "%{$reset_color%}")$vcs_info_msg_0_%{$orange%} λ%{$reset_color%} '
%{$purple%}%n%{$reset_color%} in %{$limegreen%}%~%{$reset_color%}$(rvm-prompt " with%{$fg[red]%} " v g "%{$reset_color%}")$vcs_info_msg_0_%{$orange%} λ%{$reset_color%} '
PROMPT=$'%{$fg[green]%}%n@%m: %{$reset_color%}%{$fg[blue]%}%/%{$reset_color%} local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
%{$fg_bold[red]%}➜ %{$reset_color%} ' PROMPT=$'%{$fg[green]%}%n@%m: %{$reset_color%}%{$fg[blue]%}%/ %{$reset_color%}%{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}
${ret_status} %{$reset_color%} '
PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}" PROMPT2="%{$fg_blod[black]%}%_> %{$reset_color%}"
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
...@@ -44,10 +44,7 @@ setprompt () { ...@@ -44,10 +44,7 @@ setprompt () {
### ###
# See if we can use colors. # See if we can use colors.
autoload colors zsh/terminfo autoload zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
fi
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GREY; do for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GREY; do
eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}' eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
eval PR_LIGHT_$color='%{$fg[${(L)color}]%}' eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
......
# Simple theme based on my old zsh settings. # Simple theme based on my old zsh settings.
function get_host { function get_host {
echo '@'`hostname`'' echo '@'$HOST
} }
PROMPT='> ' PROMPT='> '
......
autoload -U colors && colors
autoload -Uz vcs_info autoload -Uz vcs_info
zstyle ':vcs_info:*' stagedstr '%F{green}●' zstyle ':vcs_info:*' stagedstr '%F{green}●'
......
...@@ -13,7 +13,6 @@ local c7=$(printf "\033[38;5;149m") ...@@ -13,7 +13,6 @@ local c7=$(printf "\033[38;5;149m")
local c8=$(printf "\033[38;5;126m") local c8=$(printf "\033[38;5;126m")
local c9=$(printf "\033[38;5;162m") local c9=$(printf "\033[38;5;162m")
local foopath=$(perl /home/scp1/bin/foopath)
if [ "$TERM" = "linux" ]; then if [ "$TERM" = "linux" ]; then
c1=$(printf "\033[34;1m") c1=$(printf "\033[34;1m")
......
# reference colors # Michele Bologna's theme
GREEN="%{$fg_bold[green]%}" # http://michelebologna.net
RED="%{$fg_bold[red]%}" #
CYAN="%{$fg_bold[cyan]%}" # This a theme for oh-my-zsh. Features a colored prompt with:
YELLOW="%{$fg_bold[yellow]%}" # * username@host: [jobs] [git] workdir %
BLUE="%{$fg_bold[blue]%}" # * hostname color is based on hostname characters. When using as root, the
MAGENTA="%{$fg_bold[magenta]%}" # prompt shows only the hostname in red color.
WHITE="%{$fg_bold[white]%}" # * [jobs], if applicable, counts the number of suspended jobs tty
# * [git], if applicable, represents the status of your git repo (more on that
COLOR_ARRAY=($GREEN $RED $CYAN $YELLOW $BLUE $MAGENTA $WHITE) # later)
# * '%' prompt will be green if last command return value is 0, yellow otherwise.
# color reset #
RESET_COLOR="%{$reset_color%}" # git prompt is inspired by official git contrib prompt:
# https://github.com/git/git/tree/master/contrib/completion/git-prompt.sh
# which color should be applied? # and it adds:
USERNAME_NORMAL_COLOR=$WHITE # * the current branch
USERNAME_ROOT_COLOR=$RED # * '%' if there are untracked files
HOSTNAME_NORMAL_COLOR=$BLUE # * '$' if there are stashed changes
# uncomment next line if you want auto-generated hostname color # * '*' if there are modified files
#for i in `hostname`; HOSTNAME_NORMAL_COLOR=$COLOR_ARRAY[$[((#i))%7+1]] # * '+' if there are added files
HOSTNAME_ROOT_COLOR=$RED # * '<' if local repo is behind remote repo
HOSTNAME_COLOR=%(!.$HOSTNAME_ROOT_COLOR.$HOSTNAME_NORMAL_COLOR) # * '>' if local repo is ahead remote repo
CURRENT_DIR_COLOR=$CYAN # * '=' if local repo is equal to remote repo (in sync)
# * '<>' if local repo is diverged
# zsh commands
USERNAME_COMMAND="%n" local green="%{$fg_bold[green]%}"
HOSTNAME_COMMAND="%m" local red="%{$fg_bold[red]%}"
CURRENT_DIR="%~" local cyan="%{$fg_bold[cyan]%}"
local yellow="%{$fg_bold[yellow]%}"
# output: colors + commands local blue="%{$fg_bold[blue]%}"
USERNAME_OUTPUT="%(!..$USERNAME_NORMAL_COLOR$USERNAME_COMMAND$RESET_COLOR@)" local magenta="%{$fg_bold[magenta]%}"
HOSTNAME_OUTPUT="$HOSTNAME_COLOR$HOSTNAME_COMMAND$RESET_COLOR" local white="%{$fg_bold[white]%}"
CURRENT_DIR_OUTPUT="$CURRENT_DIR_COLOR$CURRENT_DIR" local reset="%{$reset_color%}"
LAST_COMMAND_OUTPUT="%(?.%(!.$RED.$GREEN).$YELLOW)"
local -a color_array
# git theming color_array=($green $red $cyan $yellow $blue $magenta $white)
ZSH_THEME_GIT_PROMPT_PREFIX="("
local username_normal_color=$white
local username_root_color=$red
local hostname_root_color=$red
# calculating hostname color with hostname characters
for i in `hostname`; local hostname_normal_color=$color_array[$[((#i))%7+1]]
local -a hostname_color
hostname_color=%(!.$hostname_root_color.$hostname_normal_color)
local current_dir_color=$blue
local username_command="%n"
local hostname_command="%m"
local current_dir="%~"
local username_output="%(!..$username_normal_color$username_command$reset@)"
local hostname_output="$hostname_color$hostname_command$reset"
local current_dir_output="$current_dir_color$current_dir$reset"
local jobs_bg="${red}fg: %j$reset"
local last_command_output="%(?.%(!.$red.$green).$yellow)"
ZSH_THEME_GIT_PROMPT_PREFIX=""
ZSH_THEME_GIT_PROMPT_SUFFIX="" ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY=")$RED*" ZSH_THEME_GIT_PROMPT_DIRTY=""
ZSH_THEME_GIT_PROMPT_CLEAN=")" ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_PROMPT_UNTRACKED="%%"
ZSH_THEME_GIT_PROMPT_MODIFIED="*"
ZSH_THEME_GIT_PROMPT_ADDED="+"
ZSH_THEME_GIT_PROMPT_STASHED="$"
ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE="="
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE=">"
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="<"
ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="<>"
# wrap all together PROMPT='$username_output$hostname_output:$current_dir_output%1(j. [$jobs_bg].)'
PROMPT='$USERNAME_OUTPUT$HOSTNAME_OUTPUT:$CURRENT_DIR_OUTPUT $LAST_COMMAND_OUTPUT%#$RESET_COLOR ' PROMPT+='$(__git_ps1)'
RPROMPT='%1(j.fg: [%j].) $GREEN$(git_prompt_info)$RESET_COLOR [%@]' PROMPT+=" $last_command_output%#$reset "
RPROMPT=''
setopt prompt_subst setopt prompt_subst
autoload colors
colors
autoload -U add-zsh-hook autoload -U add-zsh-hook
autoload -Uz vcs_info autoload -Uz vcs_info
......
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}[" ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[white]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="" ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}]%{$reset_color%} " ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$fg[white]%}]%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_CLEAN="]%{$reset_color%} " ZSH_THEME_GIT_PROMPT_CLEAN="]%{$reset_color%} "
ZSH_THEME_SVN_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX ZSH_THEME_SVN_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX
ZSH_THEME_SVN_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX ZSH_THEME_SVN_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX
ZSH_THEME_SVN_PROMPT_DIRTY=$ZSH_THEME_GIT_PROMPT_DIRTY ZSH_THEME_SVN_PROMPT_DIRTY=$ZSH_THEME_GIT_PROMPT_DIRTY
ZSH_THEME_SVN_PROMPT_CLEAN=$ZSH_THEME_GIT_PROMPT_CLEAN ZSH_THEME_SVN_PROMPT_CLEAN=$ZSH_THEME_GIT_PROMPT_CLEAN
ZSH_THEME_HG_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX
ZSH_THEME_HG_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX
ZSH_THEME_HG_PROMPT_DIRTY=$ZSH_THEME_GIT_PROMPT_DIRTY
ZSH_THEME_HG_PROMPT_CLEAN=$ZSH_THEME_GIT_PROMPT_CLEAN
vcs_status() { vcs_status() {
if [[ ( $(whence in_svn) != "" ) && ( $(in_svn) == 1 ) ]]; then if [[ $(whence in_svn) != "" ]] && in_svn; then
svn_prompt_info svn_prompt_info
elif [[ $(whence in_hg) != "" ]] && in_hg; then
hg_prompt_info
else else
git_prompt_info git_prompt_info
fi fi
} }
PROMPT='%2~ $(vcs_status)»%b ' PROMPT='%2~ $(vcs_status)»%b '
\ No newline at end of file
# Based on bira zsh theme with nvm, rvm and jenv support
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}'
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
local rvm_ruby=''
if which rvm-prompt &> /dev/null; then
rvm_ruby='%{$fg[red]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
else
if which rbenv &> /dev/null; then
rvm_ruby='%{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}'
fi
fi
local nvm_node=''
nvm_node='%{$fg[green]%}‹node-$(nvm_prompt_info)›%{$reset_color%}'
local jenv_java=''
jenv_java='%{$fg[blue]%}‹$(jenv_prompt_info)›%{$reset_color%}'
local git_branch='$(git_prompt_info)%{$reset_color%}'
PROMPT="╭─${user_host} ${current_dir} ${nvm_node} ${rvm_ruby} ${jenv_java} ${git_branch}
╰─%B$%b "
RPS1="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}("
ZSH_THEME_GIT_PROMPT_SUFFIX=") %{$reset_color%}"
...@@ -10,12 +10,12 @@ function my_git_prompt() { ...@@ -10,12 +10,12 @@ function my_git_prompt() {
fi fi
# is anything staged? # is anything staged?
if $(echo "$INDEX" | grep -E -e '^(D[ M]|[MARC][ MD]) ' &> /dev/null); then if $(echo "$INDEX" | command grep -E -e '^(D[ M]|[MARC][ MD]) ' &> /dev/null); then
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_STAGED" STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_STAGED"
fi fi
# is anything unstaged? # is anything unstaged?
if $(echo "$INDEX" | grep -E -e '^[ MARC][MD] ' &> /dev/null); then if $(echo "$INDEX" | command grep -E -e '^[ MARC][MD] ' &> /dev/null); then
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED" STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNSTAGED"
fi fi
...@@ -25,7 +25,7 @@ function my_git_prompt() { ...@@ -25,7 +25,7 @@ function my_git_prompt() {
fi fi
# is anything unmerged? # is anything unmerged?
if $(echo "$INDEX" | grep -E -e '^(A[AU]|D[DU]|U[ADU]) ' &> /dev/null); then if $(echo "$INDEX" | command grep -E -e '^(A[AU]|D[DU]|U[ADU]) ' &> /dev/null); then
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED" STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_UNMERGED"
fi fi
......
if [ "$(whoami)" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi if [ "$USER" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="blue"; fi
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
......
...@@ -12,7 +12,7 @@ prompt_setup_pygmalion(){ ...@@ -12,7 +12,7 @@ prompt_setup_pygmalion(){
base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g") base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g")
post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g") post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g")
add-zsh-hook precmd prompt_pygmalion_precmd precmd_functions+=(prompt_pygmalion_precmd)
} }
prompt_pygmalion_precmd(){ prompt_pygmalion_precmd(){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment