From 392eb80d400be2c146d59ad5a60c313bcfefc22b Mon Sep 17 00:00:00 2001 From: Ambrose Chua Date: Thu, 25 Feb 2021 23:24:40 +0800 Subject: [PATCH] Fix ZSH VCS dirty --- .config/nvim/init.vim | 1 + .ssh/config | 3 +++ .zshrc | 18 ++++++------------ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 4b8e92d..f4dc37f 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -4,6 +4,7 @@ " - :noh to clear highlighting " - gd to go to definition " - g* to search for current word +" - gq to reformat line into column " call plug#begin() diff --git a/.ssh/config b/.ssh/config index 5dc9d65..e88f302 100644 --- a/.ssh/config +++ b/.ssh/config @@ -18,6 +18,9 @@ Host pricklypear User ambrose Port 26779 +Host makerforce.io + Port 26779 + Host raspi Hostname raspi.cacti.makerforce.io User pi diff --git a/.zshrc b/.zshrc index 0462670..fcfda15 100644 --- a/.zshrc +++ b/.zshrc @@ -129,8 +129,11 @@ setopt prompt_subst # prompt: vcs setup_prompt_vcs() { autoload -Uz vcs_info - zstyle ':vcs_info:git:*' formats $' %b %u%c' - zstyle ':vcs_info:git:*' actionformats $'%(u..%B)%(c..%B) %b (%a) %u%c' + zstyle ':vcs_info:git:*' stagedstr $'%B' + 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:*' check-for-changes true prompt_vcs_enabled=false @@ -140,16 +143,7 @@ setup_prompt_vcs() { } format_vcs_info() { text="$1" - dirty=false - while [[ "${text[-2]}" == " " ]]; do - dirty=true - text="${text[0,-2]}" - done - if $dirty; then - echo "%B$text%b" - else - echo "$text" - fi + echo "$text" } slower_functions+=( setup_prompt_vcs ) # prompt: return code