diff options
| author | srdusr <trevorgray@srdusr.com> | 2023-06-23 17:48:47 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2023-06-23 17:48:47 +0200 |
| commit | 25f65514bf4733058b3c2f8a1dae026f93c856bf (patch) | |
| tree | 06d8d5c91074aedfb2f3f48610d1c4fb08ec8089 /.config/zsh/.zshrc | |
| parent | c39eb15234ca21a08d3a88a69164fd6b92894250 (diff) | |
| download | dotfiles-25f65514bf4733058b3c2f8a1dae026f93c856bf.tar.gz dotfiles-25f65514bf4733058b3c2f8a1dae026f93c856bf.zip | |
Improved performance of prompt
Diffstat (limited to '.config/zsh/.zshrc')
| -rw-r--r-- | .config/zsh/.zshrc | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index ca4787e..aa9e659 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -80,8 +80,8 @@ setopt interactive_comments beep extendedglob nomatch notify completeinword prom ########## Prompt(s) ########## -# Enable colors and change prompt: -autoload -U colors && colors # Load colors +# Enable colors +autoload -U colors && colors # Prompt with Vi insert-mode/normal-mode and blinking '$', note blinking '$' only works on some terminals. terminfo_down_sc=$terminfo[cud1]$terminfo[cuu1]$terminfo[sc]$terminfo[cud1] @@ -102,16 +102,16 @@ git_branch_test_color() { # Job indicator jobs_status_indicator() { - local jobs_output - declare -p jobs_output >/dev/null 2>&1 - if [[ $? -eq 0 ]]; then - unset jobs_output - fi - jobs_output=$(jobs -s) - if [[ -n "$jobs_output" ]]; then - local jobs_count=$(echo "$jobs_output" | wc -l) - echo "jobs: ${jobs_count}" - fi + local jobs_output + declare -p jobs_output >/dev/null 2>&1 + if [[ $? -eq 0 ]]; then + unset jobs_output + fi + jobs_output=$(jobs -s) + if [[ -n "$jobs_output" ]]; then + local jobs_count=$(echo "$jobs_output" | wc -l) + echo "jobs: ${jobs_count}" + fi } remote_indicator() { @@ -128,15 +128,14 @@ zstyle ':vcs_info:*' stagedstr ' +%F{15}staged%f' zstyle ':vcs_info:*' unstagedstr ' -%F{15}unstaged%f' zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:*' actionformats '%F{5}%F{2}%b%F{3}|%F{1}%a%F{5}%f ' -zstyle ':vcs_info:*' formats \ - '%F{208} '$'\uE0A0'' %f$(git_branch_test_color)%f%F{76}%c%F{3}%u%f ' +zstyle ':vcs_info:*' formats '%F{208} '$'\uE0A0'' %f$(git_branch_test_color)%f%F{76}%c%F{3}%u%f ' zstyle ':vcs_info:git*+set-message:*' hooks git-untracked zstyle ':vcs_info:*' enable git +vi-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{196} !%f%F{15}untracked%f' -fi + hook_com[unstaged]+='%F{196} !%f%F{15}untracked%f' + fi } # Prompt |
