Skip to content

Commit

Permalink
add am_git_left_right_master prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
eendroroy committed Apr 16, 2024
1 parent 4d74a00 commit 336a0f3
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 1 deletion.
11 changes: 11 additions & 0 deletions modules/git.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ am_git_left_right(){
fi
}

am_git_left_right_master(){
[[ -z "${AM_LEFT_RIGHT_SEP}" ]] && AM_LEFT_RIGHT_SEP='|'

__git_left_right=$(plib_git_left_right_master)

__left=$(echo "$__git_left_right" | awk '{print $1}' | tr -d ' \n')
__right=$(echo "$__git_left_right" | awk '{print $2}' | tr -d ' \n')

echo -ne "%F{$AM_LEFT_RIGHT_COLOR}${__left}${AM_LEFT_RIGHT_SEP}${__right}%f"
}

am_git_stash(){
if [[ "$(plib_git_is_bare)" == 1 ]]; then
echo -ne "%F{$AM_BARE_COLOR}${AM_GIT_BARE_SYM}${__stash}%f"
Expand Down
1 change: 1 addition & 0 deletions modules/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@ fi
[[ -z "${AM_GIT_REBASING_SYMBOL}" ]] && AM_GIT_REBASING_SYMBOL=''
[[ -z "${AM_GIT_PUSH_SYM}" ]] && AM_GIT_PUSH_SYM=''
[[ -z "${AM_GIT_PULL_SYM}" ]] && AM_GIT_PULL_SYM=''
[[ -z "${AM_LEFT_RIGHT_SEP}" ]] && AM_LEFT_RIGHT_SEP='|'
[[ -z "${AM_PROMPT_START_TAG}" ]] && AM_PROMPT_START_TAG=''
[[ -z "${AM_PROMPT_END_TAG}" ]] && AM_PROMPT_END_TAG=''
2 changes: 1 addition & 1 deletion modules/prompt.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ version_prompt(){

am_vcs_prompt(){
if [[ $(am_is_git) == 1 ]]; then
am_vcs_prompt_val="$(am_git_rebasing) %F{$AM_VCS_COLOR}${AM_GIT_SYM} %f$(am_git_branch) $(am_git_commit_time) $(am_git_rev) $(am_git_stash) $(am_git_left_right) $(am_git_dirty)"
am_vcs_prompt_val="$(am_git_rebasing) %F{$AM_VCS_COLOR}${AM_GIT_SYM} %f$(am_git_branch) ($(am_git_left_right_master)) $(am_git_commit_time) $(am_git_rev) $(am_git_stash) $(am_git_left_right) $(am_git_dirty)"
elif [[ $(am_is_hg) == 1 ]]; then
am_vcs_prompt_val="%F{$AM_VCS_COLOR} ${AM_HG_SYM}:%f$(am_hg_branch) $(am_hg_rev)"
elif [[ $(am_is_svn) == 1 ]]; then
Expand Down
1 change: 1 addition & 0 deletions modules/themes/default.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ am_theme(){
[[ -z ${AM_PROMPT_END_TAG_COLOR} ]] && AM_PROMPT_END_TAG_COLOR=39
[[ -z ${AM_GIT_TRACKED_COLOR} ]] && AM_GIT_TRACKED_COLOR=78
[[ -z ${AM_GIT_UN_TRACKED_COLOR} ]] && AM_GIT_UN_TRACKED_COLOR=208
[[ -z ${AM_LEFT_RIGHT_COLOR} ]] && AM_LEFT_RIGHT_COLOR=252
}
1 change: 1 addition & 0 deletions modules/themes/mono.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ am_theme(){
[[ -z ${AM_PROMPT_END_TAG_COLOR} ]] && AM_PROMPT_END_TAG_COLOR=250
[[ -z ${AM_GIT_TRACKED_COLOR} ]] && AM_GIT_TRACKED_COLOR=250
[[ -z ${AM_GIT_UN_TRACKED_COLOR} ]] && AM_GIT_UN_TRACKED_COLOR=246
[[ -z ${AM_LEFT_RIGHT_COLOR} ]] && AM_LEFT_RIGHT_COLOR=252
}
1 change: 1 addition & 0 deletions modules/themes/mono_bright.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ am_theme(){
[[ -z ${AM_PROMPT_END_TAG_COLOR} ]] && AM_PROMPT_END_TAG_COLOR=255
[[ -z ${AM_GIT_TRACKED_COLOR} ]] && AM_GIT_TRACKED_COLOR=255
[[ -z ${AM_GIT_UN_TRACKED_COLOR} ]] && AM_GIT_UN_TRACKED_COLOR=251
[[ -z ${AM_LEFT_RIGHT_COLOR} ]] && AM_LEFT_RIGHT_COLOR=254
}
1 change: 1 addition & 0 deletions modules/themes/soft.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ am_theme(){
[[ -z ${AM_PROMPT_END_TAG_COLOR} ]] && AM_PROMPT_END_TAG_COLOR=12
[[ -z ${AM_GIT_TRACKED_COLOR} ]] && AM_GIT_TRACKED_COLOR=122
[[ -z ${AM_GIT_UN_TRACKED_COLOR} ]] && AM_GIT_UN_TRACKED_COLOR=181
[[ -z ${AM_LEFT_RIGHT_COLOR} ]] && AM_LEFT_RIGHT_COLOR=254
}
1 change: 1 addition & 0 deletions modules/themes/terminal.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ am_theme(){
[[ -z ${AM_PROMPT_END_TAG_COLOR} ]] && AM_PROMPT_END_TAG_COLOR=12
[[ -z ${AM_GIT_TRACKED_COLOR} ]] && AM_GIT_TRACKED_COLOR=10
[[ -z ${AM_GIT_UN_TRACKED_COLOR} ]] && AM_GIT_UN_TRACKED_COLOR=1
[[ -z ${AM_LEFT_RIGHT_COLOR} ]] && AM_LEFT_RIGHT_COLOR=15
}

0 comments on commit 336a0f3

Please sign in to comment.