LoginSignup
6

More than 5 years have passed since last update.

zshでgit, hub, tigなどを補完する

Posted at

boxenを使っているなら以下を書くことでhub特有のコマンド(browseやpull-requestなど)も補完される.使っていないなら適切にダウンロードしてくる.

~/.zshrc
autoload -U compinit && compinit # もし書いていなければ.
source /opt/boxen/homebrew/etc/bash_completion.d/git-completion.bash
source /opt/boxen/homebrew/etc/bash_completion.d/hub.bash_completion.sh
source /opt/boxen/homebrew/etc/bash_completion.d/tig-completion.bash
compdef hub=git

なお,boxenを使っていると[ -f /opt/boxen/env.sh ] && source /opt/boxen/env.shによって強制的にalias hub=gitされるので注意.

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6