Update installation instructions in README.md

This commit is contained in:
xylous 2021-08-08 18:46:33 +03:00
parent 0387deb641
commit 61a7b27867

View File

@ -1,6 +1,6 @@
# gitstatus.zsh # gitstatus
`gitstatus.zsh` is a plugin made for prompts - it tells you how many things have `gitstatus` is a plugin made for prompts - it tells you how many things have
changed since the last git commit in a repository. changed since the last git commit in a repository.
## Why such a thing? ## Why such a thing?
@ -20,10 +20,24 @@ Is it useful? For me and probably a handful other people, yes.
### Installation ### Installation
#### Manual
Clone this repository locally, on your machine, for example: Clone this repository locally, on your machine, for example:
``` ```
git clone "https://github.com/xylous/gitstatus.zsh.git" gitstatus git clone "https://github.com/xylous/gitstatus.git" gitstatus
```
```zsh
source path/to/installation/gitstatus.plugin.zsh
```
#### With a plugin manager
You could also use a plugin manager, such as zpm:
```
zpm load xylous/gitstatus
``` ```
## Usage ## Usage
@ -31,8 +45,6 @@ git clone "https://github.com/xylous/gitstatus.zsh.git" gitstatus
Add the following lines to your zshrc: Add the following lines to your zshrc:
```zsh ```zsh
source path/to/installation/gitstatus.plugin.zsh
function precmd() function precmd()
{ {
local gitstatus="$(gitstatus)" local gitstatus="$(gitstatus)"
@ -42,7 +54,7 @@ function precmd()
`precmd()` is a zsh builtin function that executes a series of commands right `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 before the prompt is drawn. In this example, it updates the output of the
`gitstatus` script and then uses it in a prompt. `gitstatus` script and then uses it in a sample prompt.
And of course, remember to replace `path/to/installation` with the actual path And of course, remember to replace `path/to/installation` with the actual path
to the program. to the program.