Skip to content

Instantly share code, notes, and snippets.

@felipou
Created September 3, 2013 13:33
Show Gist options
  • Save felipou/6423969 to your computer and use it in GitHub Desktop.
Save felipou/6423969 to your computer and use it in GitHub Desktop.
Jump utility auto-completion for Mac OS X
# jeroen janssens' jump utility
# http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html
# tab completion for bash on Mac OS X
# I just modified the find command to pipe to the 'basename' command,
# because find on BSD doesn't support the 'printf' option
# I didn't test it on Linux, but it should probably work
_completemarks() {
local curw=${COMP_WORDS[COMP_CWORD]}
local wordlist=$(find $MARKPATH -type l | xargs -L 1 basename)
COMPREPLY=($(compgen -W '${wordlist[@]}' -- "$curw"))
return 0
}
complete -F _completemarks jump unmark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment