zsh completion installations (autojump) - How to use them?

16,273

Solution 1

Oh-my-ZSH config file should have a line starting with plugins=, like this:

plugins=(git gitignore autojump jira command-not-found zsh-syntax-highlighting)

Whatever you put there is considered by ZSH to be an active plugin.

In case of AutoJump, oh-my-ZSH Plugin Wiki states that:

Enables autojump if installed with homebrew, macports or debian/ubuntu package. This does not add any commands on its own.

Config file you are looking for: .zshrc

EDIT:

  1. Note that some folks claim FASD is better, if autojump won't work for you, you may try FASD instead.

  2. Thanks @Adaephon, added link to source of the quote and marked it's oh-my-zshell rather than pure ZSH.

Solution 2

Assumed that you use zsh shell, you have to manually add the plugin link. See the instructions blew:

  1. open .zshrc file

    nano ~/.zshrc

  2. add plugins=(autojump) in the file enter image description here

  3. re-open your terminal

Share:
16,273

Related videos on Youtube

Amelio Vazquez-Reina
Author by

Amelio Vazquez-Reina

I'm passionate about people, technology and research. Some of my favorite quotes: "Far better an approximate answer to the right question than an exact answer to the wrong question" -- J. Tukey, 1962. "Your title makes you a manager, your people make you a leader" -- Donna Dubinsky, quoted in "Trillion Dollar Coach", 2019.

Updated on September 18, 2022

Comments

  • Amelio Vazquez-Reina
    Amelio Vazquez-Reina over 1 year

    I just installed autojump and have oh-my-zsh installed in my system. I have included the log of the installation at the bottom of this post. Note that at the end it says:

    zsh completion has been installed to:
    /usr/local/share/zsh/site-functions
    

    What am I supposed to do with this information? How do I notify Zsh of this zsh completion?

    Also, whenever I now login with my Zsh shell, I get:

    /usr/local/Cellar/autojump/21.6.9/etc/autojump.bash:13: command not found: complete
    /usr/local/Cellar/autojump/21.6.9/etc/autojump.bash:52: = not found
    

    Why? How can I fix this?

    $ brew install autojump
    ==> Downloading https://github.com/joelthelion/autojump/archive/release-v21.6.9.tar.gz
    ############################################################################################################################ 100.0%
    ==> Caveats
    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/autojump.sh ]] && . `brew --prefix`/etc/autojump.sh
    
    zsh completion has been installed to:
      /usr/local/share/zsh/site-functions
    
    • Admin
      Admin over 10 years
      I take it you are on OSX?
  • Adaephon
    Adaephon about 10 years
    As you quote from the oh-my-zsh Plugin Page, I guess you are using oh-my-zsh. plugin= is part of the oh-my-zsh configuration, which is a set of configuration files for zsh. It is not part of vanilla zsh and as the questioner did not mention using oh-my-zsh it will probably not help him.
  • Amelio Vazquez-Reina
    Amelio Vazquez-Reina about 10 years
    Thanks @Adaephon I updated the OP to clarify that I use oh-my-zsh and am interested in solutions that may depend on it.
  • LAFK says Reinstate Monica
    LAFK says Reinstate Monica about 10 years
    Thanks @Adaephon - I've updated my answer to mark this as it's truly a good point. <bows>
  • RalfFriedl
    RalfFriedl almost 6 years
    It would have been less work for you and more useful to the reader to just copy the relevant text.
  • KY Lu
    KY Lu over 4 years
    I want to explain it thoroughly, so I paste the whole image with a red frame. how should I modify it to let it be more useful to readers?