1
0
Fork 0

cg function

This commit is contained in:
Gregory Eremin 2017-10-05 13:19:48 +02:00
parent b78da238b2
commit c289bd24cb
1 changed files with 4 additions and 0 deletions

View File

@ -43,6 +43,10 @@ function c { cd $(realpath $PROJECTS/$1); }
function _c { __bash_directory_complete $PROJECTS; }
complete -F _c c
function cg { cd $GOPATH/src/github.com/$1; }
function _cg { __bash_directory_complete $GOPATH/src/github.com; }
complete -F _cg cg
function __bash_directory_complete {
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=($(compgen -o nospace -W "$(ls $1)" -- $cur))