X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.shellrc;h=38f7381a7b060becb2a9ceb9b5e6237fa1dca174;hb=ed7cdee7b186fee9d99410d77ef722add83e4a32;hp=d0c9c37d5921a94ca8ae9d783113dfd781689863;hpb=322694eebf3fe68372786b97a60513142d99ac93;p=dotfiles.git diff --git a/.shellrc b/.shellrc index d0c9c37..38f7381 100644 --- a/.shellrc +++ b/.shellrc @@ -195,6 +195,17 @@ case "$SHELL" in } complete -F _cdremote_complete cdremote + + # define completion for git-open - list remotes with http(s) URLs + _git_open() { + local cur="${COMP_WORDS[COMP_CWORD]}"; + list_remotes '^http\(s\)\?://' + COMPREPLY=(`compgen -W "$GIT_REMOTES" -- "$cur"`) + GIT_REMOTES="" + unset GIT_REMOTES + } + + complete -F _git_open git-open ;; esac