Created
July 19, 2018 03:13
-
-
Save bcl/7fee1f639a9b491c3df830cbcc4e1287 to your computer and use it in GitHub Desktop.
Revisions
-
bcl created this gist
Jul 19, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ VENV_DIR=${VENV_DIR:-~/.local/virtualenv} _envon() { local venvs cur # Get the list of environments venvs=$(for x in $VENV_DIR/*; do basename "$x" ; done) cur="${COMP_WORDS[COMP_CWORD]}" COMPREPLY=( $(compgen -W "${venvs}" -- ${cur}) ) return 0 } envon() { source $VENV_DIR/$1/bin/activate } complete -F _envon envon