Skip to content

Instantly share code, notes, and snippets.

@l4u
Created December 13, 2017 03:10
Show Gist options
  • Save l4u/06502cf680b9a3817efddfb0a9a6ede8 to your computer and use it in GitHub Desktop.
Save l4u/06502cf680b9a3817efddfb0a9a6ede8 to your computer and use it in GitHub Desktop.
autojump(macOS) + fzf for fish shell
alias j="cd (cat ~/Library/autojump/autojump.txt | sort -nr | awk '{print \$2}' | fzf +s)"
@greenbech
Copy link

greenbech commented Apr 29, 2019

This doesn‘t work when the path contains a space (since awk splits on whitespace by default). But it will work with this modification:

alias j="cd (cat ~/Library/autojump/autojump.txt | sort -nr | awk -F '\t' '{print \$NF}' | fzf +s)"

This works because the number and path in the autojump.txt file is separated by a TAB (/t).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment