Skip to content

Instantly share code, notes, and snippets.

@kidpixo
Last active June 24, 2016 07:01
Show Gist options
  • Save kidpixo/a97d3344275fe351de28249891128118 to your computer and use it in GitHub Desktop.
Save kidpixo/a97d3344275fe351de28249891128118 to your computer and use it in GitHub Desktop.
Fuzzy jumping in one of the ~/.marks bookmarks used by jump/autojump. Requires fzf installed and some links in ~/.marks . Defines an 'fj' alias.
function fuzzyjump
# fuzzy cd in one of the ~/.marks bookmarks used by jump/autojump
# requires fzf installed and some links in ~/.marks
ls -l ~/.marks | awk '{print $9 $10 $11}'| sed -e '/^$/d' -e 's/\(->\)/|\1/' | column -s"|" -t | fzf | awk -F">" '{print $2}' | read -l fzf_local_result
if test -d $fzf_local_result
cd $fzf_local_result
else
echo "Directory does not exist $fzf_local_result"
end
end
alias fj 'fuzzyjump'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment