+ No longer use oh-my-zsh
This commit is contained in:
parent
44e654c1e3
commit
19260309b2
5 changed files with 242 additions and 39 deletions
32
.config/zsh/theme
Normal file
32
.config/zsh/theme
Normal file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/env zsh
|
||||
autoload -Uz vcs_info
|
||||
precmd_vcs_info() { vcs_info }
|
||||
precmd_functions+=( precmd_vcs_info )
|
||||
setopt prompt_subst
|
||||
zstyle ':vcs_info:*' stagedstr 'M'
|
||||
zstyle ':vcs_info:*' unstagedstr '!'
|
||||
zstyle ':vcs_info:*' check-for-changes true
|
||||
zstyle ':vcs_info:git:*' formats '%F{5} %b %F{1}%c%u %f'
|
||||
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked
|
||||
zstyle ':vcs_info:*' enable git
|
||||
+vi-git-untracked() {
|
||||
|
||||
# git status ahead
|
||||
if [[ $(git status --porcelain -b | grep '^## [^ ]\+ .*ahead') ]]; then
|
||||
hook_com[unstaged]+='%F{1}⇡%f'
|
||||
fi
|
||||
|
||||
# git untracked
|
||||
if [ $(git rev-parse --is-inside-work-tree 2> /dev/null) = 'true' ] && \
|
||||
[ $(git ls-files --other --directory --exclude-standard | sed q | wc -l | tr -d ' ') = 1 ] ; then
|
||||
hook_com[unstaged]+='%F{1}?%f'
|
||||
fi
|
||||
}
|
||||
|
||||
precmd () { vcs_info }
|
||||
#RPROMPT=\$vcs_info_msg_0_
|
||||
PS1="
|
||||
%B%F{blue}%~ \$vcs_info_msg_0_
|
||||
%F{green}$>%f%b "
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#60C0FF,bold,underline"
|
||||
ZSH_AUTOSUGGEST_HISTORY_IGNORE="ls *,cd *"
|
Loading…
Add table
Add a link
Reference in a new issue