LoginSignup
19
21

More than 5 years have passed since last update.

zshでもgitの補完機能使えるようにする設定

Posted at

homebrew使ってzshをインストール

$ brew install zsh

補完定義ファイルの設置

$ mkdir ~/.zsh/completion/
$ cd ~/.zsh/completion/
$ curl -O https://raw.github.com/git/git/master/contrib/completion/git-completion.bash
$ curl -O https://raw.github.com/git/git/master/contrib/completion/git-completion.zsh

git-completion.zsh_gitにリネーム

$ mv git-completion.zsh _git

.zshrcに以下の記述を追加

fpath=($(brew --prefix)/share/zsh/site-functions $fpath)

autoload -U compinit
compinit -u

zcompdumpをリビルド

$ rm -f ~/.zcompdump; compinit
19
21
0

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
19
21