Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What to source to make this work on macOS after installing with Homebrew? #511

Closed
nikitavoloboev opened this issue Nov 27, 2017 · 13 comments

Comments

@nikitavoloboev
Copy link

I can't get it to work.

Always get this message:

Please source the correct autojump file in your shell's
startup file. For more information, please reinstall autojump
and read the post installation instructions.

Thank you for any help.

@bendem
Copy link

bendem commented Nov 27, 2017

did you try the part where it says "read the post installation instructions"?

https://github.com/wting/autojump#installation

@nikitavoloboev
Copy link
Author

I have. For macOS, it only says to brew install it and that's it.

@bendem
Copy link

bendem commented Nov 27, 2017

and brew install shows you instructions after install. There is a reason it's there.

https://github.com/Homebrew/homebrew-core/blob/b6b9f36c8744c2259b74f12850163c676ae49396/Formula/autojump.rb#L27-L35

@aphe
Copy link

aphe commented Dec 5, 2017

you can see the caveat again using command

brew info autojump

and it will give you the output

autojump: stable 22.5.1 (bottled), HEAD
Shell extension to jump to frequently used directories
https://github.com/wting/autojump
/usr/local/Cellar/autojump/22.5.1 (24 files, 253.9KB) *
  Poured from bottle on 2017-11-28 at 13:37:16
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/autojump.rb
==> Caveats
Add the following line to your ~/.bash_profile or ~/.zshrc file (and remember
to source the file to update your current session):
  [ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh

If you use the Fish shell then add the following line to your ~/.config/fish/config.fish:
  [ -f /usr/local/share/autojump/autojump.fish ]; and source /usr/local/share/autojump/autojump.fish

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions

@pzelnip
Copy link

pzelnip commented Jan 31, 2018

Still doesn't work for me even after adding [ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh & sourcing the file.

I do j <dirname> and am left in my current directory instead of changing dirs.

@aphe
Copy link

aphe commented Feb 1, 2018

You have to cd <dirname> first than autojump will remember it for you the next time you call j <dirname>

@pzelnip
Copy link

pzelnip commented Feb 1, 2018

Ahh, gotcha, I misunderstood the purpose, so then autojump is more about remembering where you've been so you can go back there quickly rather than finding a deeply nested subdir from your current location?

@aphe
Copy link

aphe commented Feb 2, 2018

Yes, as cited from the README.md

It works by maintaining a database of the directories you use the most from the command line.

Directories must be visited first before they can be jumped to.

@helenes-r7
Copy link

I'm also running into this issue.
After installing through Homebrew, I added this to my .bash_profile:
[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh
I also made sure to add:
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ;} history -a"

After cd'ing into a few directories, j -s has no entries. I have to manually run the .bash_profile line in my current session. Is this a config issue with my .bash_profile somehow?

@l-gothberg
Copy link

l-gothberg commented May 16, 2018

having the same issue as @helenes-r7

After installing through Homebrew, I added this to my .bash_profile:
[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh

After cd'ing into a few directories, j -s has no entries.

And yes, I did source ~/.bash_profile to reload the session

@aphe
Copy link

aphe commented May 21, 2018

@helenes-r7 @l-gothberg You can read about the question here https://apple.stackexchange.com/questions/12993/why-doesnt-bashrc-run-automatically

@wting
Copy link
Owner

wting commented Sep 7, 2018

Thanks @bendem and @aphe for chiming in.

Autojump is a unique in the sense that it requires post-installation setup since every users are using different shells and potentially customized setups, and some package distributions don't allow post install configuration (e.g. Debian).

I plan on improving the post installation step in #323 so please redirect feedback there.

@wting wting closed this as completed Sep 7, 2018
@vfonic
Copy link

vfonic commented Apr 25, 2019

It would be great to have this in the readme:

[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh

I didn't read the post install instructions (sorry!), I just assumed it would work out of the box.
Maybe this can also be added next-to/instead-of "read post install instructions"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants