Skip to content

Instantly share code, notes, and snippets.

@albus522
Created September 30, 2010 14:26
Show Gist options
  • Save albus522/604660 to your computer and use it in GitHub Desktop.
Save albus522/604660 to your computer and use it in GitHub Desktop.
_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