From e6cac931477c2379d4c30ed08fc59295c4944695 Mon Sep 17 00:00:00 2001 From: xylous Date: Fri, 5 Nov 2021 15:13:17 +0200 Subject: [PATCH] Update misleading README.md --- README.md | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 56d1d46..54bfeb3 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,12 @@ git clone "https://github.com/xylous/gitstatus.git" gitstatus ``` ```zsh -source path/to/installation/gitstatus.plugin.zsh +source /path/to/installation/gitstatus.plugin.zsh ``` +And of course, remember to replace `/path/to/installation` with the actual path +to the program. + #### With a plugin manager You could also use a plugin manager, such as zpm: @@ -46,23 +49,17 @@ zpm load xylous/gitstatus ## Usage -Add the following lines to your zshrc: +Change your prompt to include `$(gitstatus)` wherever you need. Note that you'll +need to `setopt PROMPT_SUBST` and that you're going to need to use single +quotes. + +So, for example: ```zsh -function precmd() -{ - local gitstatus="$(gitstatus)" - PS1="%F{blue}%~%F{default} ${gitstatus} $ " -} +setopt PROMPT_SUBST +PROMPT='%F{blue}%~%F{default} $(gitstatus) $ ' ``` -`precmd()` is a zsh builtin function that executes a series of commands right -before the prompt is drawn. In this example, it updates the output of the -`gitstatus` script and then uses it in a sample prompt. - -And of course, remember to replace `path/to/installation` with the actual path -to the program. - ## Roadmap - [x] add screenshots