Skip to content

Commit

Permalink
[zsh] snipe: better handling for jj projects
Browse files Browse the repository at this point in the history
  • Loading branch information
meain committed Jan 30, 2025
1 parent e95fb24 commit 4dac816
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions zsh/.config/zsh/.zsh-custom/themes/snipe.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,16 @@ function _git_pushable() {
_vcs_info_wrapper() {
vcs_info
if echo "${vcs_info_msg_0_}" | grep -qE 'jj/keep'; then
echo "@" # controlled by jujutsu
line="$(jj log -r @ --no-graph)"
if echo "$line" | grep -q "(empty)"; then
echo -e "%F{002}$(echo "$line" | cut -d' ' -f1)%{$reset_color%}"
elif echo "$line" | grep -q "(no description set)"; then
echo -e "%F{003}$(echo "$line" | cut -d' ' -f1)%{$reset_color%}"
else
echo "$line" | cut -d' ' -f1
fi
else
echo "${vcs_info_msg_0_}"
echo "%F{green}${vcs_info_msg_0_}%{$reset_color%}"
fi
}

Expand Down Expand Up @@ -152,7 +159,7 @@ function generate_lpropmpt() {
if [[ -n "$TMUX" ]] ; then
PROMPT_GREPPER=" "
fi
echo "${${KEYMAP/vicmd/$NORMAL_COLOR}/(main|viins)/$INSERT_COLOR}${_return_status}${_tmux_indicator}%F{green}$( _vcs_info_wrapper )%F{yellow}%B%(1j.#.)%{$reset_color%}$PROMPT_GREPPER"
echo "${${KEYMAP/vicmd/$NORMAL_COLOR}/(main|viins)/$INSERT_COLOR}${_return_status}${_tmux_indicator}$( _vcs_info_wrapper )%F{yellow}%B%(1j.#.)%{$reset_color%}$PROMPT_GREPPER"
}

function generate_rpropmpt() {
Expand Down

0 comments on commit 4dac816

Please sign in to comment.