From 81f7175f768d5fa653003a3cf09dd04cee0f4fb4 Mon Sep 17 00:00:00 2001 From: David Paz Date: Thu, 15 Dec 2016 13:05:23 +0100 Subject: [PATCH 1/4] Add service icon definition for fa-patched Add configuration for icon definitions on 'flat'|'awesome-patched' section. --- functions/icons.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions/icons.zsh b/functions/icons.zsh index 2f30cff2..a30b59f0 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -68,6 +68,9 @@ case $POWERLEVEL9K_MODE in VCS_BRANCH_ICON $'\uE220' #  VCS_REMOTE_BRANCH_ICON ' '$'\uE804 ' #  VCS_GIT_ICON $'\uE20E ' #  + VCS_GIT_GITHUB_ICON $'\uE20E ' # + VCS_GIT_BITBUCKET_ICON $'\uE20E ' # + VCS_GIT_GITLAB_ICON $'\uE20E ' # VCS_HG_ICON $'\uE1C3 ' #  VCS_SVN_ICON '(svn) ' RUST_ICON '' From e7ab1e9eedfce22364b5aeb3c8c96d1c1c766879 Mon Sep 17 00:00:00 2001 From: David Paz Date: Thu, 15 Dec 2016 13:06:32 +0100 Subject: [PATCH 2/4] Add service icon definition on fa-regular Add configuration for icons on section 'awesome-fontconfig'. --- functions/icons.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/functions/icons.zsh b/functions/icons.zsh index a30b59f0..b6d277fc 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -124,7 +124,10 @@ case $POWERLEVEL9K_MODE in VCS_COMMIT_ICON $'\uF221 ' #  VCS_BRANCH_ICON $'\uF126' #  VCS_REMOTE_BRANCH_ICON ' '$'\uF204 ' #  - VCS_GIT_ICON $'\uF113 ' #  + VCS_GIT_ICON $'\uF1D3 ' #  + VCS_GIT_GITHUB_ICON $'\uF113 ' #  + VCS_GIT_BITBUCKET_ICON $'\uF171 ' #  + VCS_GIT_GITLAB_ICON $'\uF296 ' #  VCS_HG_ICON $'\uF0C3 ' #  VCS_SVN_ICON '(svn) ' RUST_ICON $'\uE6A8' #  From 528e648c048bff1c021e144894b050b0ce2fe7bf Mon Sep 17 00:00:00 2001 From: David Paz Date: Thu, 15 Dec 2016 13:07:15 +0100 Subject: [PATCH 3/4] Add service icon definition on Powerline-Patched Fonts Add configuration for service icons in section "Powerline-Patched Font". --- functions/icons.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/functions/icons.zsh b/functions/icons.zsh index b6d277fc..7ae3e5a4 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -182,9 +182,12 @@ case $POWERLEVEL9K_MODE in VCS_BRANCH_ICON $'\uE0A0 ' #  VCS_REMOTE_BRANCH_ICON $'\u2192' # → VCS_GIT_ICON '' + VCS_GIT_GITHUB_ICON '' + VCS_GIT_BITBUCKET_ICON '' + VCS_GIT_GITLAB_ICON '' VCS_HG_ICON '' VCS_SVN_ICON '' - RUST_ICON '' + RUST_ICON '' PYTHON_ICON '' ) ;; From f2cac2273a662127cf9dc25471047cdd0c116701 Mon Sep 17 00:00:00 2001 From: David Paz Date: Thu, 15 Dec 2016 13:08:21 +0100 Subject: [PATCH 4/4] Assign git service icon depending on repo origin Check git origin url to search for well know services. Return proper icon if service found, if not return "git" icon from font-awesome icon set --- functions/vcs.zsh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/functions/vcs.zsh b/functions/vcs.zsh index a0aa2b6c..2a461659 100644 --- a/functions/vcs.zsh +++ b/functions/vcs.zsh @@ -110,7 +110,18 @@ function +vi-hg-bookmarks() { function +vi-vcs-detect-changes() { if [[ "${hook_com[vcs]}" == "git" ]]; then - vcs_visual_identifier='VCS_GIT_ICON' + + local remote=`git ls-remote --get-url` + if [[ "$remote" =~ "github" ]] then + vcs_visual_identifier='VCS_GIT_GITHUB_ICON' + elif [[ "$remote" =~ "bitbucket" ]] then + vcs_visual_identifier='VCS_GIT_BITBUCKET_ICON' + elif [[ "$remote" =~ "gitlab" ]] then + vcs_visual_identifier='VCS_GIT_GITLAB_ICON' + else + vcs_visual_identifier='VCS_GIT_ICON' + fi + elif [[ "${hook_com[vcs]}" == "hg" ]]; then vcs_visual_identifier='VCS_HG_ICON' elif [[ "${hook_com[vcs]}" == "svn" ]]; then