my xfce4 dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.8 KiB

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