summaryrefslogtreecommitdiff
path: root/functions/vcs.zsh
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2016-12-21 18:22:13 +0300
committerGitHub <noreply@github.com>2016-12-21 18:22:13 +0300
commit3a3238444d96f278d5898a521db6e563e9e41f3d (patch)
tree97126f99d4420cd3aae653b0031323facc36a8d9 /functions/vcs.zsh
parent5ea003bf5e25db56c97909aa273858be4a65217f (diff)
parentf2cac2273a662127cf9dc25471047cdd0c116701 (diff)
Merge pull request #360 from davidmpaz/icon_by_repo
Display different icons depending on remote type in VCS segment.
Diffstat (limited to 'functions/vcs.zsh')
-rw-r--r--functions/vcs.zsh13
1 files changed, 12 insertions, 1 deletions
diff --git a/functions/vcs.zsh b/functions/vcs.zsh
index 93925f15..5defa9bc 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