Autojump: fish support

Created on 8 Jun 2012  ·  14Comments  ·  Source: wting/autojump

i can haz fish support?

enhancement

Most helpful comment

@uri Homebrew version (21.6.9) is fairly old and doesn't include Fish support, and the instructions coming out of the newest manual installer are actually wrong.

Look for autojump.fish where all other shell files are installed (/etc/profile.d/autojump.fish for global installs) and source it in ~/.config/fish/config.fish.

All 14 comments

Implementation shouldn't be difficult (add autojump.fish wrapper), but not a priority. You're more than welcome to add it and send a pull request.

try putting this into your config.fish file (located in ~/.config/fish/):

function j
    cd (command autojump $argv)
end

adding "function j" like that in the fish config works, but does not seem to update the database. Does it require the rest of the code to be ported to autojump.fish?

Every directory you visit needs to be added to the database via a shell hook. This is done in Bash by modifying $PROMPT_COMMAND, and adding a function to Zsh's preexec_functions. I'm not sure what the fish equivalent would be.

add one line to ~/.config/fish/functions/fish_prompt.fish
autojump -a $PWD > /dev/null &
or define a cd function to overwrite default builtin cd .

function cd
   if test -d $argv
      autojump -a $argv
    end
   builtin cd
end

I installed z-fish instead. Works good.

:+1: for official fish support

I've added a shell wrapper for Fish in #209.

Is fish support in place? I tried installing via homebrew and then manually and it doesn't seem to work. After the manual installation there's a message referencing a ~/.fishrc file but fish doesn't use a fish.rc file.

I tried it anyways, [[ -s ~/.autojump/etc/profile.d/autojump.fish ]] && . ~/.autojump/etc/profile.d/autojump.fish but AFAIK fish doesn't even use &&.

@uri Homebrew version (21.6.9) is fairly old and doesn't include Fish support, and the instructions coming out of the newest manual installer are actually wrong.

Look for autojump.fish where all other shell files are installed (/etc/profile.d/autojump.fish for global installs) and source it in ~/.config/fish/config.fish.

Thanks @a13xb it's working!

Im having issues getting autojump working in fish shell
Installed from apt im on version 2.6
Ran autojump and i get a message to read the config
Config does not have instructions for fish
Can someone confirm the line i need to add to my fish config please

@BenShaw I copied autojump.fish to ~/.config/fish/functions/ on Ubuntu Linux and it worked. Not sure what OS you are using Fish on. YMMV

I ended up uninstalling autojump and installing z-fish like @espen. I did not like the fact that every time cd or jumped my fish prompt was showing a still running process.
selection_548
I also prefer z.fish's frequency rating. It is more what I would expect and matches what I have come to expect in fish shell.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rsparkyc picture rsparkyc  ·  11Comments

shepherdwind picture shepherdwind  ·  11Comments

tmarti2 picture tmarti2  ·  22Comments

thundertrick picture thundertrick  ·  34Comments

loveencounterflow picture loveencounterflow  ·  6Comments