X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.shellrc;h=9cee28309e4200258628c5406fc220bb11b4eac5;hb=a3f51e2b4e6e0c32f94e09ea9698194392dbc264;hp=2f7e05bab78d7854c05b7cfd87a90add4e8de835;hpb=e1b60c59b8d885a5ce80788c1325cb6c12c6dd66;p=dotfiles.git diff --git a/.shellrc b/.shellrc index 2f7e05b..9cee283 100644 --- a/.shellrc +++ b/.shellrc @@ -116,6 +116,7 @@ if test -n "$BASH_VERSION"; then _wget_completion_loader() { _completion_loader wget complete -F _wget wget-m wget-wrapper ww + unset _wget_completion_loader return 124 } complete -F _wget_completion_loader wget-m wget-wrapper ww @@ -130,6 +131,7 @@ if test -n "$BASH_VERSION"; then _rsync_completion_loader() { _completion_loader rsync complete -F _rsync r + unset _rsync_completion_loader return 124 } complete -F _rsync_completion_loader r @@ -139,6 +141,7 @@ if test -n "$BASH_VERSION"; then _ssh_completion_loader() { _completion_loader ssh complete -F _ssh s + unset _ssh_completion_loader return 124 } complete -F _ssh_completion_loader s @@ -220,22 +223,24 @@ if test -x /usr/bin/git >/dev/null 2>&1; then done } - # completion for cdremote - list remotes with directories as URLs - _cdremote_complete() { + # completion for cdremote and git-open - list remotes with a pattern + _list_remotes_completion() { local cur="${COMP_WORDS[COMP_CWORD]}"; - _list_remotes '^\(/\|\.\./\)' # (/ or ../ at the beginning) + _list_remotes "$1" COMPREPLY=(`compgen -W "$GIT_REMOTES" -- "$cur"`) unset GIT_REMOTES } + # completion for cdremote - list remotes with directories as URLs + _cdremote_complete() { + _list_remotes_completion '^\(/\|\.\./\)' # (/ or ../ at the beginning) + } + complete -F _cdremote_complete cdremote # 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"`) - unset GIT_REMOTES + _list_remotes_completion '^http\(s\)\?://' } complete -F _git_open git-open