mac安裝autojump

  1. 安裝zsh:sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  2. 將zsh設置成默認的shell:chsh -s /bin/zsh (重啓shell)
  3. echo $SHELL能夠查看用的哪一個shell(bash or zsh)
  4. 安裝autojump:brew install autojump(確保有brew)
  5. 使用vim .zshrc打開.zshrc(有些人會找不到.zshrc這個文件,其實安裝了zsh纔會有.zshrc ,在默認打開的終端目錄下。能夠打開終端而且ls -a查看)。
    1. 找到 plugins=,在後面添加autojump:plugins=(git autojump)
    2. 新開一行,添加:[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
    3. :wq保存退出
  6. 重啓終端,autojump就可使用了,例如:

      添加一條快捷鍵:j -a s '/Users/XXX/Desktop/code/shark’(j -a 你定義的快捷命令 ‘須要跳轉的目錄位置’)git

      進入shark:j sgithub

相關文章
相關標籤/搜索