在Mac OSX Yosemite上安装autojump后,j,jco,jc或jo不存在

问题描述 投票:9回答:2

我在我的Mac OSX Yosemite上使用brew安装了autojump

brew install autojump 

现在,我无法使用它,因为当我尝试使用它时:

jc asfg
-bash: jc: command not found

jo asfg
-bash: jo: command not found

j asdj
-bash: j: command not found

它们都不存在。关于我做错了什么的任何建议?

谢谢

macos osx-yosemite
2个回答
10
投票

如果您还没有这样做,可能需要按照我最近安装时的说明进行操作:

Add the following line to your ~/.bash_profile or ~/.zshrc file (and remember
to source the file to update your current session):
  [[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh

例如,如果您将行添加到.bash_profile,则可以按如下方式获取:

. ~/.bash_profile

或者,只需启动一个新的命令shell,变量就应该生效了。

如果你没有取得任何成功,那就是时候严重麻烦了。

如果安装正确,您应该在brew目录下有一个名为autojump.sh的文件(您可以使用brew --prefix查看)。如果该文件存在,您应该能够执行以下命令,该命令应该暂时允许在该特定shell中使用autojump命令:

. $(brew --prefix)/etc/profile.d/autojump.sh 

如果您成功使用autojump命令,则需要修改.bashrc或.zshrc文件,如本答案顶部所述。

如果autojump命令仍然无处可见,我会尝试“brew uninstall autojump”,接着是“brew install autojump”。哦,请确保完全遵循安装成功后“警告”部分中的说明。


4
投票

假设你使用zsh shell,你必须手动添加插件链接。请参阅说明书:

  1. 打开.zshrc文件 nano ~/.zshrcvim ~/.zshrc
  2. plugins=(autojump)文件中添加enter image description here
  3. 重新打开你的终端
© www.soinside.com 2019 - 2024. All rights reserved.