diff --git a/README.md b/README.md index 6903620cef97491926d13e4863ee6180b001119a..d433541b9389d731a71d481075294f9e3b8b60cc 100644 --- a/README.md +++ b/README.md @@ -78,10 +78,11 @@ eval "$(hub alias -s)" hub repository contains tab-completion scripts for bash and zsh. These scripts complement existing completion scripts that ship with git. +[Installation instructions](etc) + * [hub bash completion](https://github.com/github/hub/blob/master/etc/hub.bash_completion.sh) * [hub zsh completion](https://github.com/github/hub/blob/master/etc/hub.zsh_completion) - Commands -------- diff --git a/etc/README.md b/etc/README.md new file mode 100644 index 0000000000000000000000000000000000000000..991de3e1e3bebc162abf7b7b42ae17c262e76494 --- /dev/null +++ b/etc/README.md @@ -0,0 +1,37 @@ +# Installation instructions + +## bash + Homebrew + +If you're using Homebrew, just run `brew install hub` and you should be all set with auto-completion. + +## bash + +Open your `.bashrc` file if you're on Linux, or your `.bash_profile` if you're on OS X and add: + +```sh +if [ -f /path/to/hub.bash_completion ]; then + . /path/to/hub.bash_completion +fi +``` + +## zsh + +Create a new folder for completions: + +```sh +mkdir -p ~/.zsh/completions +``` + +Copy the file `/etc/hub.zsh_completion` from the location where you downloaded `hub` to the folder `~/.zsh/completions/` and rename it to `_hub`: + +```sh +cp /path/to/etc/hub.zsh_completion ~/.zsh/completions/ \ + mv ~/.zsh/completions/hub.zsh_completion ~/.zsh/completions/_hub +``` + +Then add the following lines to your `.zshrc` file: + +```sh +fpath=(~/.zsh/completions $fpath) +autoload -U compinit && compinit +```