Created
September 3, 2013 13:33
-
-
Save felipou/6423969 to your computer and use it in GitHub Desktop.
Jump utility auto-completion for Mac OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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