autojump icon indicating copy to clipboard operation
autojump copied to clipboard

cd: The directory 'Please source the correct autojump file in your shell's' does not exist

Open hacpai opened this issue 10 years ago • 10 comments

My shell is fish-shell 2.1.1

OS is OS X 10.10.2

hacpai avatar Jan 25 '15 14:01 hacpai

If you are using bash, run this script:

echo ' [[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh' >> ~/.bashrc && source ~/.bashrc

For zsh or fish, just replace the profile name.

Via https://www.quora.com/How-can-I-source-autojump-a-very-handy-tool-used-in-directory-jumping-in-Mac-OS

shuding avatar Jan 26 '16 04:01 shuding

The correct way to do it is to run the following command:

  • Bash: echo "/usr/share/autojump/autojump.bash" >> ~/.bashrc

  • ZSH: echo "/usr/share/autojump/autojump.zsh" >> ~/.zshrc

  • Fish: echo "/usr/share/autojump/autojump.fish" >> ~/.fishrc

varunagrawal avatar Jun 28 '17 20:06 varunagrawal

@varunagrawal

  • ZSH: echo "/usr/share/autojump/autojump.zsh" >> ~/.zshrc

gorilla001 avatar Aug 07 '17 02:08 gorilla001

I guess you should source the file too, so it should be something like:

  • ZSH: echo "source /usr/share/autojump/autojump.zsh" >> ~/.zhrc

spydon avatar Feb 22 '18 12:02 spydon

For macOS, zsh: Open ~/.zhrc:open .zhrc Find "plugins=(git)" Add the name of plugin you just install. Then it will become "plugins=(git autojump)", just like this:

2018-02-26 5 01 43

I hope this will help!

iZhangZheng avatar Feb 26 '18 09:02 iZhangZheng

@iZhangZheng this only works if you are using oh-my-zsh or something else that handles plugins, it would for example be antigen bundle autojump if you use zsh with antigen.

spydon avatar Feb 27 '18 14:02 spydon

For macOS, zsh: Open ~/.zhrc:open .zhrc Find "plugins=(git)" Add the name of plugin you just install. Then it will become "plugins=(git autojump)", just like this:

2018-02-26 5 01 43

I hope this will help!

I suppose it should be ~/.zshrc ?

BaksiLi avatar Nov 14 '18 09:11 BaksiLi

For anyone having this issue with bash on Ubuntu 18.04 (real machine or WSL), try this:

echo -e "# autojump\nsource /usr/share/autojump/autojump.bash" >> ~/.bashrc

Then reload your shell. Hope this helps!

DarylPinto avatar Apr 17 '20 12:04 DarylPinto

For anyone having this issue with bash on Ubuntu 18.04 (real machine or WSL), try this:

echo -e "# autojump\nsource /usr/share/autojump/autojump.bash" >> ~/.bashrc

Then reload your shell. Hope this helps!

it worked for me ❤️ (using solus 4.1 and bash 5.0.11)

kareemkasem avatar Dec 11 '20 14:12 kareemkasem

you can run brew info autojump and see the command on it


eg: image

xujuvenile avatar Nov 26 '21 14:11 xujuvenile