Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add icons for git item #502

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 28 additions & 8 deletions functions/_tide_item_git.fish
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,32 @@ function _tide_item_git
set -g tide_git_bg_color $tide_git_bg_color_unstable
end

_tide_print_item git $_tide_location_color$tide_git_icon' ' (set_color white; echo -ns $location
set_color $tide_git_color_operation; echo -ns ' '$operation ' '$step/$total_steps
set_color $tide_git_color_upstream; echo -ns ' ⇣'$behind ' ⇡'$ahead
set_color $tide_git_color_stash; echo -ns ' *'$stash
set_color $tide_git_color_conflicted; echo -ns ' ~'$conflicted
set_color $tide_git_color_staged; echo -ns ' +'$staged
set_color $tide_git_color_dirty; echo -ns ' !'$dirty
set_color $tide_git_color_untracked; echo -ns ' ?'$untracked)
# Icon for github if remote is set as github.com
if git remote -v | grep "[email protected]" >/dev/null
set -g tide_git_remote_icon "  "
else if test $(git remote -v | wc -l) -eq 0
set -g tide_git_remote_icon " 󰅛 "
else
set -g tide_git_remote_icon ""
end

if set -q tide_git_icon_true
_tide_print_item git $_tide_location_color$tide_git_remote_icon$tide_git_icon' ' (set_color white; echo -ns $location $tide_git_icon_spacer
set_color $tide_git_color_operation; echo -ns ' '$operation ' '$step/$total_steps
set_color $tide_git_color_upstream; echo -ns $tide_git_icon_upstream_behind$behind tide_git_icon_upstream_ahead$ahead
set_color $tide_git_color_stash; echo -ns $tide_git_icon_stash$stash
set_color $tide_git_color_conflicted; echo -ns $tide_git_icon_conflicted$conflicted
set_color $tide_git_color_staged; echo -ns $tide_git_icon_staged$staged
set_color $tide_git_color_dirty; echo -ns $tide_git_icon_dirty$dirty
set_color $tide_git_color_untracked; echo -ns $tide_git_icon_untracked$untracked)
else
_tide_print_item git $_tide_location_color$tide_git_icon' ' (set_color white; echo -ns $location
set_color $tide_git_color_operation; echo -ns ' '$operation ' '$step/$total_steps
set_color $tide_git_color_upstream; echo -ns ' ⇣'$behind ' ⇡'$ahead
set_color $tide_git_color_stash; echo -ns ' *'$stash
set_color $tide_git_color_conflicted; echo -ns ' ~'$conflicted
set_color $tide_git_color_staged; echo -ns ' +'$staged
set_color $tide_git_color_dirty; echo -ns ' !'$dirty
set_color $tide_git_color_untracked; echo -ns ' ?'$untracked)
end
end
26 changes: 22 additions & 4 deletions functions/tide/configure/choices/all/icons.fish
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,30 @@ function _enable_icons
set -g fake_tide_pwd_icon_home 
set -g fake_tide_cmd_duration_icon 
set -g fake_tide_git_icon 
set -g fake_tide_git_icon_true true
set -g fake_tide_git_icon_spacer ''
set -g fake_tide_git_icon_upstream_behind ⇣
set -g fake_tide_git_icon_upstream_ahead ⇡
set -g fake_tide_git_icon_stash ' 󱉰 '
set -g fake_tide_git_icon_conflicted '  '
set -g fake_tide_git_icon_staged '  '
set -g fake_tide_git_icon_dirty '  '
set -g fake_tide_git_icon_untracked ' 󰩌 '
end

function _disable_icons
_tide_find_and_remove os fake_tide_left_prompt_items
set fake_tide_pwd_icon
set fake_tide_pwd_icon_home
set fake_tide_cmd_duration_icon
set fake_tide_git_icon
set -g fake_tide_pwd_icon
set -g fake_tide_pwd_icon_home
set -g fake_tide_cmd_duration_icon
set -g fake_tide_git_icon
set -e fake_tide_git_icon_true
set -g fake_tide_git_icon_spacer ' '
set -g fake_tide_git_icon_upstream_behind ⇣
set -g fake_tide_git_icon_upstream_ahead ⇡
set -g fake_tide_git_icon_stash ' *'
set -g fake_tide_git_icon_conflicted ' ~'
set -g fake_tide_git_icon_staged ' +'
set -g fake_tide_git_icon_dirty ' !'
set -g fake_tide_git_icon_untracked ' ?'
end
7 changes: 7 additions & 0 deletions functions/tide/configure/icons.fish
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ tide_docker_icon 
tide_elixir_icon 
tide_gcloud_icon 󰊭 # Actual google cloud glyph is harder to see
tide_git_icon
tide_git_icon_upstream_behind ⇣
tide_git_icon_upstream_ahead ⇡
tide_git_icon_stash 󱉰
tide_git_icon_conflicted 
tide_git_icon_staged 
tide_git_icon_dirty 
tide_git_icon_untracked 󰩌
tide_go_icon 
tide_java_icon 
tide_jobs_icon 
Expand Down