Skip to content

Commit

Permalink
Make new zsh completion #132
Browse files Browse the repository at this point in the history
  • Loading branch information
Turiok committed Nov 8, 2023
1 parent a5ba6fe commit 6791680
Show file tree
Hide file tree
Showing 5 changed files with 504 additions and 26 deletions.
48 changes: 26 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ I also made a youtube video to demonstrate the common usages

The branch color distinguishes 5 situations between local and remote branches:

color | meaning
---|---
white| local has no remote
green| local is the same as remote
red| local has diverged from remote
purple| local is ahead of remote (good for push)
yellow| local is behind remote (good for merge)
| color | meaning |
| ------ | ---------------------------------------- |
| white | local has no remote |
| green | local is the same as remote |
| red | local has diverged from remote |
| purple | local is ahead of remote (good for push) |
| yellow | local is behind remote (good for merge) |

The choice of purple for ahead and yellow for behind is motivated by
[blueshift](https://en.wikipedia.org/wiki/Blueshift) and [redshift](https://en.wikipedia.org/wiki/Redshift),
Expand All @@ -57,12 +57,12 @@ See the [customization section](#custom).

The additional status symbols denote

symbol | meaning
---|---
`+`| staged changes
`*`| unstaged changes
`?`| untracked files/folders
`$`| stashed contents
| symbol | meaning |
| ------ | ----------------------- |
| `+` | staged changes |
| `*` | unstaged changes |
| `?` | untracked files/folders |
| `$` | stashed contents |

The bookkeeping sub-commands are

Expand Down Expand Up @@ -158,12 +158,16 @@ the branch color to work.
See [this stackoverflow post](https://stackoverflow.com/questions/51680709/colored-text-output-in-powershell-console-using-ansi-vt100-codes) for details.

## Auto-completion
### Bash
Download [.gita-completion.bash](https://github.com/nosarthur/gita/blob/master/.gita-completion.bash) and source it in shell.

### Zsh
There are 2 options :
- [.gita-completion.zsh](https://github.com/nosarthur/gita/blob/master/contrib.completion/zsh/.gita-completion.zsh). Use the help of gita command to display options. It uses the bash completion system for zsh.
Add `autoload -U +X bashcompinit && bashcompinit` in .zshrc and source the zsh file
- [_gita](https://github.com/nosarthur/gita/blob/master/contrib.completion/zsh/_gita_).
Completion more Zsh style. Copy it in a folder and add this folder path in `FPATH` variable. This completion file doesn't take account to command from cmds.json

Download
[.gita-completion.bash](https://github.com/nosarthur/gita/blob/master/.gita-completion.bash)
or
[.gita-completion.zsh](https://github.com/nosarthur/gita/blob/master/.gita-completion.zsh)
and source it in shell.

## <a name='superman'></a> Superman mode

Expand Down Expand Up @@ -381,10 +385,10 @@ their results agree.

## Tips

effect | shell command
---|---
enter `<repo>` directory|`` cd `gita ls <repo>` ``
delete repos in `<group>` | `gita group ll <group> \| xargs gita rm`
| effect | shell command |
| ------------------------- | ---------------------------------------- |
| enter `<repo>` directory | `` cd `gita ls <repo>` `` |
| delete repos in `<group>` | `gita group ll <group> \| xargs gita rm` |

## Contributing

Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 6791680

Please sign in to comment.