]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/plugins/mercurial/README.md
...
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / plugins / mercurial / README.md
1 # Mercurial plugin
2
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.
5
6 To use it, add `mercurial` to the plugins array in your zshrc file:
7
8 ```zsh
9 plugins=(... mercurial)
10 ```
11
12 ## Aliases
13
14 | Alias   | Command                                     |
15 | ------- | ------------------------------------------- |
16 | `hga`   | `hg add`                                    |
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`                               |
24 | `hgd`   | `hg diff`                                   |
25 | `hged`  | `hg diffmerge`                              |
26 | `hgp`   | `hg push`                                   |
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`                       |
36
37 ## Prompt usage
38
39 - Switch to a theme which uses `hg_prompt_info`
40
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.
44
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:
47
48   ```zsh
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%}'
50   ```
51
52 You can also redefine additional vars used in the plugin (after Oh My Zsh is sourced):
53
54 ```zsh
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]%})"
59 ```
60
61 ### Display repo branch and directory status in prompt
62
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.
65
66 ## Maintainers
67
68 - [ptrv](https://github.com/ptrv): original creator
69 - [oshybystyi](https://github.com/oshybystyi)