Fix ZSH VCS dirty
parent
0719d9cedb
commit
392eb80d40
|
@ -4,6 +4,7 @@
|
||||||
" - :noh to clear highlighting
|
" - :noh to clear highlighting
|
||||||
" - gd to go to definition
|
" - gd to go to definition
|
||||||
" - g* to search for current word
|
" - g* to search for current word
|
||||||
|
" - gq to reformat line into column
|
||||||
"
|
"
|
||||||
|
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
|
|
|
@ -18,6 +18,9 @@ Host pricklypear
|
||||||
User ambrose
|
User ambrose
|
||||||
Port 26779
|
Port 26779
|
||||||
|
|
||||||
|
Host makerforce.io
|
||||||
|
Port 26779
|
||||||
|
|
||||||
Host raspi
|
Host raspi
|
||||||
Hostname raspi.cacti.makerforce.io
|
Hostname raspi.cacti.makerforce.io
|
||||||
User pi
|
User pi
|
||||||
|
|
18
.zshrc
18
.zshrc
|
@ -129,8 +129,11 @@ setopt prompt_subst
|
||||||
# prompt: vcs
|
# prompt: vcs
|
||||||
setup_prompt_vcs() {
|
setup_prompt_vcs() {
|
||||||
autoload -Uz vcs_info
|
autoload -Uz vcs_info
|
||||||
zstyle ':vcs_info:git:*' formats $' %b %u%c'
|
zstyle ':vcs_info:git:*' stagedstr $'%B'
|
||||||
zstyle ':vcs_info:git:*' actionformats $'%(u..%B)%(c..%B) %b (%a) %u%c'
|
zstyle ':vcs_info:git:*' unstagedstr $'%B'
|
||||||
|
#zstyle ':vcs_info:git:*' unstagedstr "$(tput smul)"
|
||||||
|
zstyle ':vcs_info:git:*' formats $'%u%c%m %b %%b'
|
||||||
|
zstyle ':vcs_info:git:*' actionformats $'%u%c%m %b (%a) %%b'
|
||||||
zstyle ':vcs_info:*' enable git
|
zstyle ':vcs_info:*' enable git
|
||||||
zstyle ':vcs_info:*' check-for-changes true
|
zstyle ':vcs_info:*' check-for-changes true
|
||||||
prompt_vcs_enabled=false
|
prompt_vcs_enabled=false
|
||||||
|
@ -140,16 +143,7 @@ setup_prompt_vcs() {
|
||||||
}
|
}
|
||||||
format_vcs_info() {
|
format_vcs_info() {
|
||||||
text="$1"
|
text="$1"
|
||||||
dirty=false
|
echo "$text"
|
||||||
while [[ "${text[-2]}" == " " ]]; do
|
|
||||||
dirty=true
|
|
||||||
text="${text[0,-2]}"
|
|
||||||
done
|
|
||||||
if $dirty; then
|
|
||||||
echo "%B$text%b"
|
|
||||||
else
|
|
||||||
echo "$text"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
slower_functions+=( setup_prompt_vcs )
|
slower_functions+=( setup_prompt_vcs )
|
||||||
# prompt: return code
|
# prompt: return code
|
||||||
|
|
Loading…
Reference in New Issue