From 89df1a786109be84c7e9aae29081a0fdd50f8c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 25 Feb 2016 13:10:20 +0100 Subject: [PATCH 1/2] Fix PROMPT modification example The robbyrussell theme changed, so we must change the example. See https://github.com/robbyrussell/oh-my-zsh/pull/4619#commitcomment-16324023 --- plugins/mercurial/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/mercurial/README.md b/plugins/mercurial/README.md index f42212d68..c26444e98 100644 --- a/plugins/mercurial/README.md +++ b/plugins/mercurial/README.md @@ -1,4 +1,5 @@ # Mercurial plugin + ### Usage Update .zshrc: @@ -11,7 +12,7 @@ Update .zshrc: The `robbyrussell` theme is used by default, so you need to modify `$PROMPT` var by adding `$(hg_prompt_info)` after `$(git_prompt_info)`, so it looks like this: ```zsh - PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)$(hg_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' + PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)$(hg_prompt_info)' ``` 3. Initialize additional vars used in plugin. So in short put next in **.zshrc**: From 25850ed2509ae2b97c0e297417cac705033e6b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 25 Feb 2016 18:12:45 +0100 Subject: [PATCH 2/2] Clarify modification instructions to avoid confusion Also: - Explicitly warn against modifying the theme directly in the `themes/` folder. - Delete the _pretty obvious_ phrase because it adds nothing. --- plugins/mercurial/README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/mercurial/README.md b/plugins/mercurial/README.md index c26444e98..bffd9ea15 100644 --- a/plugins/mercurial/README.md +++ b/plugins/mercurial/README.md @@ -4,12 +4,19 @@ Update .zshrc: 1. Add name to the list of plugins, e.g. `plugins=(... mercurial ...)` - (that is pretty obvious). -2. Switch to a theme which uses `hg_prompt_info`. - Or, customize the `$PROMPT` variable of your current theme to contain current folder mercurial repo info. This can be done by putting a custom version of the theme in `$ZSH_CUSTOM` or by changing `$PROMPT` in `.zshrc` after loading the theme. +2. Switch to a theme that uses the `hg_prompt_info` function. - The `robbyrussell` theme is used by default, so you need to modify `$PROMPT` var by adding `$(hg_prompt_info)` after `$(git_prompt_info)`, so it looks like this: + _Or_, customize the `$PROMPT` variable of your current theme to use the `hg_prompt_info` function. + You can do this 2 ways: + + - Copy the theme into `$ZSH_CUSTOM` and modify the `$PROMPT` variable there. + + - Change the `$PROMPT` variable in `.zshrc`, after loading oh-my-zsh. + + **WARNING:** do not change the theme directly in the `themes/` folder. That will cause conflicts when trying to update. + + Example: if you're using the `robbyrussell` theme, you need to modify the `$PROMPT` var by appending `$(hg_prompt_info)` to it, so it looks like this: ```zsh PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)$(hg_prompt_info)'