tiktok-sparo/zsh-plugin/sparo/README.md

57 lines
2.6 KiB
Markdown
Raw Normal View History

2024-03-27 16:43:54 -04:00
# sparo zsh plugin
This "sparo" zsh plugin provides many aliases just like [git zsh plugin](https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/README.md) does.
## Install & Update
```shell
sh -c "$(curl -fsSL https://raw.githubusercontent.com/tiktok/sparo/main/zsh-plugin/sparo/install.sh)" "" main
```
To use it, add `sparo` to the plugins array in your zshrc file:
2024-03-28 17:15:49 -04:00
**~/.zshrc**
2024-03-27 16:43:54 -04:00
```shell
plugins=(... sparo)
```
Or, manually load it by appending the following code to your zshrc file:
2024-03-28 17:15:49 -04:00
**~/.zshrc**
```shell
2024-03-27 16:43:54 -04:00
source $ZSH/custom/plugins/sparo/sparo.plugin.zsh
2024-03-28 17:15:49 -04:00
```
2024-03-27 16:43:54 -04:00
## Aliases
| Alias | Command
| :--------------------- | :-------------------------------------------------- |
| `sa` | `sparo add` |
| `sb` | `sparo branch` |
| `sco` | `sparo checkout` |
| `scm` | `sparo checkout $(git_main_branch)` |
| `scl` | `sparo clone` |
| `sc` | `sparo commit` |
| `scmsg` | `sparo commit --message` |
| `sc!` | `sparo commit --amend` |
| `sd` | `sparo diff` |
| `sf` | `sparo fetch` |
| `sfo` | `sparo fetch origin` |
| `sl` | `sparo pull` |
| `sp` | `sparo push` |
| `spf!` | `sparo push --force` |
| `spf` | `sparo push --force-with-lease --force-if-includes` |
| `srb` | `sparo rebase` |
| `srba` | `sparo rebase --abort` |
| `srbc` | `sparo rebase --continue` |
| `srbi` | `sparo rebase --interactive` |
| `sst` | `sparo status` |
## Functions
| Command | Description |
| :--------------------- | :----------------------------------------------------------------------------- |
| `git_main_branch` | Returns the name of the main branch: `main` if it exists, `master` otherwise. |