2015-07-17 06:49:11 +03:00
|
|
|
# Installation instructions
|
|
|
|
|
2019-03-12 17:04:38 +03:00
|
|
|
## Homebrew
|
2015-10-13 23:49:14 +03:00
|
|
|
|
2019-03-12 16:57:39 +03:00
|
|
|
If you're using Homebrew, just run `brew install hub` and you should be all set
|
|
|
|
with auto-completion. The extra steps to install hub completion scripts outlined
|
|
|
|
below are *not needed*.
|
|
|
|
|
|
|
|
For bash/zsh, a one-time setup might be needed to [enable completion for all
|
|
|
|
Homebrew programs](https://docs.brew.sh/Shell-Completion).
|
2015-10-13 23:49:14 +03:00
|
|
|
|
2015-10-18 04:59:48 +03:00
|
|
|
## bash
|
2015-10-13 23:49:14 +03:00
|
|
|
|
2017-02-06 17:24:38 +03:00
|
|
|
Open your `.bashrc` file if you're on Linux, or your `.bash_profile` if you're on macOS and add:
|
2015-10-13 23:49:14 +03:00
|
|
|
|
|
|
|
```sh
|
|
|
|
if [ -f /path/to/hub.bash_completion ]; then
|
2017-02-06 17:24:38 +03:00
|
|
|
. /path/to/hub.bash_completion
|
2015-10-13 23:49:14 +03:00
|
|
|
fi
|
|
|
|
```
|
|
|
|
|
2015-07-17 06:49:11 +03:00
|
|
|
## zsh
|
|
|
|
|
2017-02-06 17:24:38 +03:00
|
|
|
Copy the file `etc/hub.zsh_completion` from the location where you downloaded
|
|
|
|
`hub` to the folder `~/.zsh/completions/` and rename it to `_hub`:
|
2015-07-17 06:49:11 +03:00
|
|
|
|
|
|
|
```sh
|
|
|
|
mkdir -p ~/.zsh/completions
|
2017-02-06 17:24:38 +03:00
|
|
|
cp etc/hub.zsh_completion ~/.zsh/completions/_hub
|
2015-07-17 06:49:11 +03:00
|
|
|
```
|
|
|
|
|
2015-10-13 23:49:14 +03:00
|
|
|
Then add the following lines to your `.zshrc` file:
|
2015-07-17 06:49:11 +03:00
|
|
|
|
|
|
|
```sh
|
|
|
|
fpath=(~/.zsh/completions $fpath)
|
|
|
|
autoload -U compinit && compinit
|
2015-10-13 23:49:14 +03:00
|
|
|
```
|
2017-01-23 16:43:42 +03:00
|
|
|
|
|
|
|
## fish
|
|
|
|
|
2017-02-06 17:24:38 +03:00
|
|
|
Copy the file `etc/hub.fish_completion` from the location where you downloaded
|
2017-02-05 18:37:05 +03:00
|
|
|
`hub` to the folder `~/.config/fish/completions/` and rename it to `hub.fish`:
|
2017-01-23 16:43:42 +03:00
|
|
|
|
|
|
|
```sh
|
2017-02-05 18:37:05 +03:00
|
|
|
mkdir -p ~/.config/fish/completions
|
2017-02-06 17:24:38 +03:00
|
|
|
cp etc/hub.fish_completion ~/.config/fish/completions/hub.fish
|
2017-01-23 16:43:42 +03:00
|
|
|
```
|