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
|
```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
|
#### With a plugin manager
|
||||||
|
|
||||||
You could also use a plugin manager, such as zpm:
|
You could also use a plugin manager, such as zpm:
|
||||||
|
@ -46,23 +49,17 @@ zpm load xylous/gitstatus
|
||||||
|
|
||||||
## Usage
|
## 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
|
```zsh
|
||||||
function precmd()
|
setopt PROMPT_SUBST
|
||||||
{
|
PROMPT='%F{blue}%~%F{default} $(gitstatus) $ '
|
||||||
local gitstatus="$(gitstatus)"
|
|
||||||
PS1="%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
|
## Roadmap
|
||||||
|
|
||||||
- [x] add screenshots
|
- [x] add screenshots
|
||||||
|
|
Loading…
Reference in New Issue