Update misleading README.md
This commit is contained in:
parent
ad0d1cafb4
commit
e6cac93147
25
README.md
25
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
|
||||
|
|
Loading…
Reference in New Issue