From 49b8024947ecd2ed538878e94e1d0ed8f0420905 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Sat, 4 Apr 2015 23:24:36 +0200 Subject: [PATCH 1/2] Show active mercurial bookmark. --- powerlevel9k.zsh-theme | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 1662d58d..0acd44bc 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -104,6 +104,8 @@ zstyle ':vcs_info:git*+set-message:*' hooks git-untracked git-aheadbehind git-st zstyle ':vcs_info:hg*:*' branchformat "%b" # The `get-revision` function must be turned on for dirty-check to work for Hg zstyle ':vcs_info:hg*:*' get-revision true +zstyle ':vcs_info:hg*:*' get-bookmarks true +zstyle ':vcs_info:hg*+gen-hg-bookmark-string:*' hooks hg-bookmarks if [[ "$POWERLEVEL9K_SHOW_CHANGESET" == true ]]; then zstyle ':vcs_info:*' get-revision true @@ -236,6 +238,18 @@ function +vi-git-stash() { fi } +function +vi-hg-bookmarks() { + if [[ -n "${hgbmarks[@]}" ]]; then + hook_com[hg-bookmark-string]=" ☿ ${hgbmarks[@]}" + + # And to signal, that we want to use the sting we just generated, + # set the special variable `ret' to something other than the default + # zero: + ret=1 + return 0 + fi +} + function +vi-vcs-detect-changes() { if [[ -n ${hook_com[staged]} ]] || [[ -n ${hook_com[unstaged]} ]]; then VCS_WORKDIR_DIRTY=true From fddf341d5cee2f5d46a11443a90c57be42adede9 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Sat, 4 Apr 2015 23:26:52 +0200 Subject: [PATCH 2/2] Added documentation. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 880904f9..728b9574 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ information in configurable prompt segments. * being behind / ahead of your remote by some number of commits * number of stashes (git only) * conditionally shows remote tracking branch if the name differs from local + * current active bookmark (mercurial only) * various working tree statuses (e.g., unstaged, staged, etc.,) * Shows return-code of the last command if it is an error code * Indicates background jobs with a gear icon @@ -142,6 +143,7 @@ The `vcs` segment uses various symbols to tell you the state of your repository: * `✚` - There are staged changes in your working copy * `?` - There are files in your working copy, that are unknown to your repository * `→` - The name of your branch differs from its tracking branch. +* `☿` - A mercurial bookmark is active. ### Styling