- 安裝zsh:sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- 將zsh設置成默認的shell:chsh -s /bin/zsh (重啓shell)
- echo $SHELL能夠查看用的哪一個shell(bash or zsh)
- 安裝autojump:brew install autojump(確保有brew)
- 使用vim .zshrc打開.zshrc(有些人會找不到.zshrc這個文件,其實安裝了zsh纔會有.zshrc ,在默認打開的終端目錄下。能夠打開終端而且ls -a查看)。
- 找到 plugins=,在後面添加autojump:plugins=(git autojump)
- 新開一行,添加:[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
- :wq保存退出
- 重啓終端,autojump就可使用了,例如:
添加一條快捷鍵:j -a s '/Users/XXX/Desktop/code/shark’(j -a 你定義的快捷命令 ‘須要跳轉的目錄位置’)git
進入shark:j sgithub