diff --git a/base/sources/gitlab.zsh b/base/sources/gitlab.zsh new file mode 100644 index 0000000..314c945 --- /dev/null +++ b/base/sources/gitlab.zsh @@ -0,0 +1,47 @@ +__zplug::sources::gitlab::check() +{ + __zplug::sources::github::check "$argv[@]" +} + +__zplug::sources::gitlab::install() +{ + __zplug::sources::github::install "$argv[@]" +} + +__zplug::sources::gitlab::update() +{ + __zplug::sources::github::update "$argv[@]" +} + +__zplug::sources::gitlab::get_url() +{ + local repo="$1" url_format + + case "$ZPLUG_PROTOCOL" in + HTTPS | https) + # https://git::@gitlab.com/%s.git + url_format="https://git::@gitlab.com/${repo}.git" + ;; + SSH | ssh) + # git@gitlab.com:%s.git + url_format="git@gitlab.com:${repo}.git" + ;; + esac + + echo "$url_format" +} + +__zplug::sources::gitlab::load_plugin() +{ + __zplug::sources::github::load_plugin "$argv[@]" +} + +__zplug::sources::gitlab::load_command() +{ + __zplug::sources::github::load_command "$argv[@]" +} + +__zplug::sources::gitlab::load_theme() +{ + __zplug::sources::github::load_theme "$argv[@]" +} diff --git a/doc/guide/External-Sources.md b/doc/guide/External-Sources.md index 17672c2..7800aa2 100644 --- a/doc/guide/External-Sources.md +++ b/doc/guide/External-Sources.md @@ -4,6 +4,7 @@ If there is a service/framework you want to install from that's not supported by zplug (yet!), you can add your own. We call these "sources." [GitHub](https://github.com), [Bitbucket](https://bitbucket.org), [GitHub Gist](https://gist.github.com), GitHub releases, +[Gitlab](https://gitlab.com), [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh), and [prezto](https://github.com/sorin-ionescu/prezto) are supported by default. Sources are what you specify with the `from` tag (e.g. `from:bitbucket`), so diff --git a/doc/man/man1/zplug.1 b/doc/man/man1/zplug.1 index b75c8dc..e972049 100644 --- a/doc/man/man1/zplug.1 +++ b/doc/man/man1/zplug.1 @@ -53,7 +53,8 @@ Can manage everything .IP \(bu 2.3 .\} Zsh plugins/UNIX commands on -GitHub +GitHub, +Gitlab and Bitbucket .RE @@ -380,7 +381,7 @@ T}:T{ Specify the service from which you install T}:T{ .sp -github,bitbucket,gh\-r,gist, oh\-my\-zsh,prezto,local (github) +github,gitlab,bitbucket,gh\-r,gist, oh\-my\-zsh,prezto,local (github) T}:T{ .sp from:gh\-r @@ -764,6 +765,11 @@ zplug "b4b4r07/hello_bitbucket", \e hook\-build:"chmod 755 *\&.sh", \e use:"*\&.sh" +# Support Gitlab +zplug "willemmali-sh/chegit", \e + as:command, \e + from:gitlab + # Group dependencies, emoji\-cli depends on jq in this example zplug "stedolan/jq", \e as:command, \e diff --git a/doc/man/man5/zplug-from.5 b/doc/man/man5/zplug-from.5 index 16c3e86..e977e7b 100644 --- a/doc/man/man5/zplug-from.5 +++ b/doc/man/man5/zplug-from.5 @@ -50,7 +50,7 @@ T} lt lt. T{ .sp -github, bitbucket, gh\-r, gist, oh\-my\-zsh, local +github, gitlab, bitbucket, gh\-r, gist, oh\-my\-zsh, local T}:T{ .sp github diff --git a/doc/txt/zplug-from.txt b/doc/txt/zplug-from.txt index 3d442a3..90e0ade 100644 --- a/doc/txt/zplug-from.txt +++ b/doc/txt/zplug-from.txt @@ -23,10 +23,10 @@ will be installed as the plugin or as the command. .zplug from tag [options="header"] -|================================================================ -| Possive Values | Default value -| github, bitbucket, gh-r, gist, oh-my-zsh, local | github -|================================================================ +|========================================================================= +| Possive Values | Default value +| github, gitlab, bitbucket, gh-r, gist, oh-my-zsh, local | github +|========================================================================= Besides, by using `zstyle` command, you can change default value: diff --git a/doc/zplug.txt b/doc/zplug.txt index 905922e..ff88c99 100644 --- a/doc/zplug.txt +++ b/doc/zplug.txt @@ -26,7 +26,7 @@ Unlike antigen, zplug requires no ZSH plugin file (`*.plugin.zsh`). It's such a fantabulous piece of software. * Can manage everything -** Zsh plugins/UNIX commands on https://github.com[GitHub] +** Zsh plugins/UNIX commands on https://github.com[GitHub], https://gitlab.com[Gitlab], and https://bitbucket.org[Bitbucket] ** Gist file (https://gist.github.com[gist.github.com]) ** Third-party sources e.g., @@ -123,7 +123,7 @@ and so on. If you want to use extended glob, see later section for setting the z `use:"*darwin*"` |*from* | Specify the service from which you install -| `github`,`bitbucket`,`gh-r`,`gist`, +| `github`, `gitlab`,`bitbucket`,`gh-r`,`gist`, `oh-my-zsh`,`prezto`,`local` (`github`) | `from:gh-r` |*at* | Branch, tag, or commit to use | *revision* (`master`) | `at:v1.5.6` @@ -338,6 +338,11 @@ zplug "b4b4r07/hello_bitbucket", \ hook-build:"chmod 755 *.sh", \ use:"*.sh" +# Support Gitlab +zplug "willemmali-sh/chegit", \ + as:command, \ + from:gitlab + # Group dependencies, emoji-cli depends on jq in this example zplug "stedolan/jq", \ as:command, \ diff --git a/misc/completions/_zplug b/misc/completions/_zplug index a50d5c2..c8f7677 100644 --- a/misc/completions/_zplug +++ b/misc/completions/_zplug @@ -110,7 +110,7 @@ case "$words[1]" in _values -S : -s , "zplug tags" \ "as[$_zplug_tags[as]]:as:(plugin command theme)" \ "use[$_zplug_tags[use]]:use:->use" \ - "from[$_zplug_tags[from]]:from:(gh-r gist oh-my-zsh github bitbucket local)" \ + "from[$_zplug_tags[from]]:from:(gh-r gist oh-my-zsh github gitlab bitbucket local)" \ "at[$_zplug_tags[at]]:at:" \ "rename-to[$_zplug_tags[rename-to]]:rename-to:" \ "dir[$_zplug_tags[dir]]:dir:->dir" \