3 This plugin adds some handy aliases for using Mercurial as well as a few
4 utility and prompt functions that can be used in a theme.
6 To use it, add `mercurial` to the plugins array in your zshrc file:
9 plugins=(... mercurial)
15 | ------- | ------------------------------------------- |
17 | `hgc` | `hg commit` |
18 | `hgca` | `hg commit --amend` |
19 | `hgci` | `hg commit --interactive` |
20 | `hgb` | `hg branch` |
21 | `hgba` | `hg branches` |
22 | `hgbk` | `hg bookmarks` |
23 | `hgco` | `hg checkout` |
25 | `hged` | `hg diffmerge` |
27 | `hgs` | `hg status` |
28 | `hgsl` | `hg log --limit 20 --template "<template>"` |
29 | `hgun` | `hg resolve --list` |
30 | `hgi` | `hg incoming` |
31 | `hgl` | `hg pull -u` |
32 | `hglr` | `hg pull --rebase` |
33 | `hgo` | `hg outgoing` |
34 | `hglg` | `hg log --stat -v` |
35 | `hglgp` | `hg log --stat -p -v` |
39 - Switch to a theme which uses `hg_prompt_info`
41 - Or customize the `$PROMPT` variable of your current theme to contain current folder mercurial repo info.
42 This can be done by putting a custom version of the theme in `$ZSH_CUSTOM` or by changing `$PROMPT` in
43 `.zshrc` after loading the theme.
45 For example, for the `robbyrussell` theme you need to modify `$PROMPT` var by adding `$(hg_prompt_info)`
46 after `$(git_prompt_info)`, so it looks like this:
49 PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)$(hg_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
52 You can also redefine additional vars used in the plugin (after Oh My Zsh is sourced):
55 ZSH_THEME_HG_PROMPT_PREFIX="%{$fg_bold[magenta]%}hg:(%{$fg[red]%}"
56 ZSH_THEME_HG_PROMPT_SUFFIX="%{$reset_color%}"
57 ZSH_THEME_HG_PROMPT_DIRTY="%{$fg[magenta]%}) %{$fg[yellow]%}✗%{$reset_color%}"
58 ZSH_THEME_HG_PROMPT_CLEAN="%{$fg[magenta]%})"
61 ### Display repo branch and directory status in prompt
63 This is the same as git plugin does. **Note**: additional changes to `.zshrc`, or using a theme designed
64 to use `hg_prompt_info`, are required in order for this to work.
68 - [ptrv](https://github.com/ptrv): original creator
69 - [oshybystyi](https://github.com/oshybystyi)