Created
September 30, 2010 14:26
-
-
Save albus522/604660 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
_rvm_cd_complete () | |
{ | |
local cur matches i j | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
j=${#COMPREPLY[@]} | |
for dir in $(echo $CDPATH | tr -s ':' ' ') ; do | |
for i in $( compgen -d $dir/$cur ) ; do | |
i="${i}/" | |
COMPREPLY[j++]=${i#$dir/} | |
done | |
done | |
} | |
complete -o filenames -o nospace -F _rvm_cd_complete cd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment