oh-my-bash/completion/dirs.completion.sh
Toan Nguyen e65c390bfa Improve oh-my-bash functionality
* Implement aliases, completion in oh-my-bash
 * Added default themes from Bash-it
 * Fixed few issues
2017-10-10 18:07:01 +07:00

16 lines
426 B
Bash

#!/usr/bin/env bash
# Bash completion support for the 'dirs' plugin (commands G, R).
_dirs-complete() {
local CURRENT_PROMPT="${COMP_WORDS[COMP_CWORD]}"
# parse all defined shortcuts from ~/.dirs
if [ -r "$HOME/.dirs" ]; then
COMPREPLY=($(compgen -W "$(grep -v '^#' ~/.dirs | sed -e 's/\(.*\)=.*/\1/')" -- ${CURRENT_PROMPT}) )
fi
return 0
}
complete -o default -o nospace -F _dirs-complete G R