From c289bd24cbd7bb903ba7eb99b4ade072bfffa0c4 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Thu, 5 Oct 2017 13:19:48 +0200 Subject: [PATCH] cg function --- bash/functions.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bash/functions.bash b/bash/functions.bash index 54bf51e..c2a40da 100644 --- a/bash/functions.bash +++ b/bash/functions.bash @@ -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))