projects
/
shutils.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
git: Add git-pull-all
[shutils.git]
/
dotfiles
/
shell
/
.zshrc
diff --git
a/dotfiles/shell/.zshrc
b/dotfiles/shell/.zshrc
index 1b74f6d744e6eae18087b4cdba35707f374e5e39..c187a58e7204deab9b5afed3f3b2a028e43a0986 100644
(file)
--- a/
dotfiles/shell/.zshrc
+++ b/
dotfiles/shell/.zshrc
@@
-14,7
+14,7
@@
zstyle ':completion::complete:*' use-cache 1
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
-
colors
+ colors
fi
eval `dircolors`
fi
eval `dircolors`
@@
-54,14
+54,14
@@
bindkey "\e[8~" end-of-line
setopt \
setopt \
-
EXTENDEDGLOB \
-
BASH_AUTO_LIST \
-
LIST_AMBIGUOUS \
-
CHECK_JOBS \
-
INC_APPEND_HISTORY \
-
HIST_IGNORE_DUPS \
-
HIST_IGNORE_SPACE \
-
NO_HUP
+ EXTENDEDGLOB \
+ BASH_AUTO_LIST \
+ LIST_AMBIGUOUS \
+ CHECK_JOBS \
+ INC_APPEND_HISTORY \
+ HIST_IGNORE_DUPS \
+ HIST_IGNORE_SPACE \
+ NO_HUP
HISTFILE=~/.zsh_history
HISTFILE=~/.zsh_history
@@
-70,6
+70,16
@@
SAVEHIST=50000
REPORTTIME=5
TIMEFMT="$fg[magenta]%J %U user %S sys %P cpu %*E total %M MB RSS max$terminfo[sgr0]"
REPORTTIME=5
TIMEFMT="$fg[magenta]%J %U user %S sys %P cpu %*E total %M MB RSS max$terminfo[sgr0]"
+
+# Load starship if exists, and that's it.
+#if [ $TERM != "linux" ] && type "starship" > /dev/null; then
+ eval "$(starship init zsh)"
+ return
+#fi
+
+
+# Otherwise, do some homebrewn configuration
+
autoload -Uz vcs_info && vcs_info
zstyle ':vcs_info:*' enable git cvs svn hg
zstyle ':vcs_info:*' use-prompt-escapes
autoload -Uz vcs_info && vcs_info
zstyle ':vcs_info:*' enable git cvs svn hg
zstyle ':vcs_info:*' use-prompt-escapes
@@
-78,13
+88,13
@@
zstyle ':vcs_info:*' max-exports 1
function setprompt()
{
function setprompt()
{
-
# default: " (%s)-[%b|%a]%u%c-"
-
zstyle ':vcs_info:*' actionformats " %s: %b|%a"
-
# default: " (%s)-[%b]%u%c-"
-
zstyle ':vcs_info:*' formats " %s: %b"
+ # default: " (%s)-[%b|%a]%u%c-"
+ zstyle ':vcs_info:*' actionformats " %s: %b|%a"
+ # default: " (%s)-[%b]%u%c-"
+ zstyle ':vcs_info:*' formats " %s: %b"
-
setopt PROMPT_SUBST
-
PROMPT='
+ setopt PROMPT_SUBST
+ PROMPT='
%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%})%n@%m%{$reset_color%}$PR_SCREEN$PR_JOBS%{$fg_bold[yellow]%}${vcs_info_msg_0_}%{$reset_color%} %{$fg_bold[blue]%}%~%{$reset_color%}
$PR_EXIT%# '
}
%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%})%n@%m%{$reset_color%}$PR_SCREEN$PR_JOBS%{$fg_bold[yellow]%}${vcs_info_msg_0_}%{$reset_color%} %{$fg_bold[blue]%}%~%{$reset_color%}
$PR_EXIT%# '
}
@@
-96,7
+106,7
@@
autofs_mp=()
function precmd ()
{
function precmd ()
{
-
PR_EXIT="%{$fg_bold[red]%}%(?..[%?] )%{$reset_color%}"
+ PR_EXIT="%{$fg_bold[red]%}%(?..[%?] )%{$reset_color%}"
# Check whether current directory is a subdirectory of an autofs mountpoint
local parent="0"
# Check whether current directory is a subdirectory of an autofs mountpoint
local parent="0"
@@
-107,11
+117,12
@@
function precmd ()
parent="1"
# Even equal!
if echo "$mp" | /bin/grep -q $PWD; then
parent="1"
# Even equal!
if echo "$mp" | /bin/grep -q $PWD; then
-
vcs_info_msg_0_=" [autofs]"
+ vcs_info_msg_0_=" [autofs]"
fi
break;
fi
done
fi
break;
fi
done
+
if [ -z "$vcs_info_msg_0_" ]; then
if [ "$parent" = "1" ]; then
# svn and hg cause complaints of autofs that .svn and .hg is no mount point
if [ -z "$vcs_info_msg_0_" ]; then
if [ "$parent" = "1" ]; then
# svn and hg cause complaints of autofs that .svn and .hg is no mount point
@@
-119,20
+130,17
@@
function precmd ()
else
zstyle ':vcs_info:*' enable git cvs svn hg
fi
else
zstyle ':vcs_info:*' enable git cvs svn hg
fi
-
vcs_info
+ vcs_info
fi
fi
-
PR_SCREEN=""
-
if [[ -n "${WINDOW}" ]]; then
-
PR_SCREEN=" S:${WINDOW}"
-
fi
+ PR_SCREEN=""
+ if [[ -n "${WINDOW}" ]]; then
+ PR_SCREEN=" S:${WINDOW}"
+ fi
-
PR_JOBS=""
-
if [[ $(jobs | wc -l) -gt 0 ]]; then
-
PR_JOBS=" J:%j"
-
fi
+ PR_JOBS=""
+ if [[ $(jobs | wc -l) -gt 0 ]]; then
+ PR_JOBS=" J:%j"
+ fi
}
}
-
-
-