summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorDavid Paz <david.paz@flagbit.de>2016-12-15 15:08:21 +0300
committerDavid Paz <david.paz@flagbit.de>2016-12-15 15:08:21 +0300
commitf2cac2273a662127cf9dc25471047cdd0c116701 (patch)
tree4daeaf4568d1a1e877326bf85c42e58585ec090b /functions
parent528e648c048bff1c021e144894b050b0ce2fe7bf (diff)
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
Diffstat (limited to 'functions')
-rw-r--r--functions/vcs.zsh13
1 files changed, 12 insertions, 1 deletions
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