From cad39c59dd6def7e199094b3ce34b1c59b72386e Mon Sep 17 00:00:00 2001 From: Ahmad Ansori Palembani Date: Fri, 25 Apr 2025 07:34:57 +0700 Subject: [PATCH] chore: Move stuff around --- .config/zsh/include/theme | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.config/zsh/include/theme b/.config/zsh/include/theme index ec8c573..9201573 100644 --- a/.config/zsh/include/theme +++ b/.config/zsh/include/theme @@ -4,13 +4,19 @@ autoload -Uz vcs_info precmd_vcs_info() { vcs_info } precmd_functions+=( precmd_vcs_info ) setopt prompt_subst + +# jj and git support +zstyle ':vcs_info:*' enable git jj + +zstyle ':vcs_info:jj:*' formats '%F{5}(jj)  %b %F{1}%c%u %f' +zstyle ':vcs_info:git:*' formats '%F{5}(git)  %b %F{1}%c%u %f' + zstyle ':vcs_info:*' stagedstr 'M' zstyle ':vcs_info:*' unstagedstr '!' zstyle ':vcs_info:*' check-for-changes true -zstyle ':vcs_info:jj:*' formats '%F{5}(jj)  %b %F{1}%c%u %f' -zstyle ':vcs_info:git:*' formats '%F{5}(git)  %b %F{1}%c%u %f' + +# git specific, finding unntracked files zstyle ':vcs_info:git*+set-message:*' hooks git-untracked -zstyle ':vcs_info:*' enable git jj +vi-git-untracked() { # Return early if we're not in git dir [ $(git rev-parse --is-inside-work-tree 2> /dev/null) = 'true' ] || return 0 @@ -48,10 +54,10 @@ _fix_cursor() { } precmd () { - RPROMPT="" # for some reason path added to RPROMPT in macOS, I have no idea where it's coming from + # Force macOS to be a bit more sane + RPROMPT="" vcs_info _fix_cursor } -#RPROMPT=\$vcs_info_msg_0_ ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#60C0FF,bold,underline" -ZSH_AUTOSUGGEST_HISTORY_IGNORE="ls *,cd *" +ZSH_AUTOSUGGEST_HISTORY_IGNORE="ls *,cd *,z *"