Autojump function in the fish shell
Playing with the fish shell I was missing the auto jump function which I was used to from zsh. So I ported the function from bash to fish:
Add the following function to ~/.config/fish/config.fish
:
function j
set new_path (autojump $argv)
if test -d "$new_path"
echo $new_path
cd "$new_path"
else
echo "autojump: directory '$argv' not found"
echo "Try \`autojump --help\` for more information."
false
end
end
Usage examples:
-
j Down
- changes to my Downloads folder -
j work
- changes to my workspace folder
Together wish the built in autocomplete in fish this is quite nice.
Written by Adrian
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#