Code Monkey home page Code Monkey logo

zplug's Introduction

🇺🇸 🇯🇵

Zsh Plugin Manager

Travis Latest Slack


Pros.

  • Can manage everything
  • Super-fast parallel installation/update
  • Support for lazy-loading
  • Branch/tag/commit support
  • Post-update, post-load hooks
  • Dependencies between packages
  • Unlike antigen, no ZSH plugin file (*.plugin.zsh) required
  • Interactive interface (fzf, peco, zaw, and so on)
  • Cache mechanism for reducing the startup time

DEMO:

Installation

latest stable
Latest Stable

The best way

curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh

Curious about the installation script? Check it out at zplug/installer.

Using Homebrew (OS X)

brew install zplug

Manually

Cloning from GitHub, and source init.zsh:

$ export ZPLUG_HOME=/path/to/.zplug
$ git clone https://github.com/zplug/zplug $ZPLUG_HOME

Requirements

  • zsh: version 4.3.9 or higher
  • git: version 1.7 or higher
  • awk: An AWK variant that's not mawk

Usage

Add a zplug section to your .zshrc:

  1. List the packages with zplug commands
  2. zplug load to source the plugins and add commands to your $PATH

Example

source ~/.zplug/init.zsh

# Make sure to use double quotes
zplug "zsh-users/zsh-history-substring-search"

# Use the package as a command
# And accept glob patterns (e.g., brace, wildcard, ...)
zplug "Jxck/dotfiles", as:command, use:"bin/{histuniq,color}"

# Can manage everything e.g., other person's zshrc
zplug "tcnksm/docker-alias", use:zshrc

# Disable updates using the "frozen" tag
zplug "k4rthik/git-cal", as:command, frozen:1

# Grab binaries from GitHub Releases
# and rename with the "rename-to:" tag
zplug "junegunn/fzf", \
    from:gh-r, \
    as:command, \
    use:"*darwin*amd64*"

# Supports oh-my-zsh plugins and the like
zplug "plugins/git",   from:oh-my-zsh

# Also prezto
zplug "modules/prompt", from:prezto

# Load if "if" tag returns true
zplug "lib/clipboard", from:oh-my-zsh, if:"[[ $OSTYPE == *darwin* ]]"

# Run a command after a plugin is installed/updated
# Provided, it requires to set the variable like the following:
# ZPLUG_SUDO_PASSWORD="********"
zplug "jhawthorn/fzy", \
    as:command, \
    rename-to:fzy, \
    hook-build:"make && sudo make install"

# Supports checking out a specific branch/tag/commit
zplug "b4b4r07/enhancd", at:v1
zplug "mollifier/anyframe", at:4c23cb60

# Can manage gist file just like other packages
zplug "b4b4r07/79ee61f7c140c63d2786", \
    from:gist, \
    as:command, \
    use:get_last_pane_path.sh

# Support bitbucket
zplug "b4b4r07/hello_bitbucket", \
    from:bitbucket, \
    as:command, \
    use:"*.sh"

# Rename a command with the string captured with `use` tag
zplug "b4b4r07/httpstat", \
    as:command, \
    use:'(*).sh', \
    rename-to:'$1'

# Group dependencies
# Load "emoji-cli" if "jq" is installed in this example
zplug "stedolan/jq", \
    from:gh-r, \
    as:command, \
    rename-to:jq
zplug "b4b4r07/emoji-cli", \
    on:"stedolan/jq"
# Note: To specify the order in which packages should be loaded, use the defer
#       tag described in the next section

# Set the priority when loading
# e.g., zsh-syntax-highlighting must be loaded
# after executing compinit command and sourcing other plugins
# (If the defer tag is given 2 or above, run after compinit command)
zplug "zsh-users/zsh-syntax-highlighting", defer:2

# Can manage local plugins
zplug "~/.zsh", from:local

# Load theme file
zplug 'dracula/zsh', as:theme

# Install plugins if there are plugins that have not been installed
if ! zplug check --verbose; then
    printf "Install? [y/N]: "
    if read -q; then
        echo; zplug install
    fi
fi

# Then, source plugins and add commands to $PATH
zplug load --verbose

Finally, use zplug install to install your plugins and reload .zshrc.

1. Options for zplug

Option Description
--help Display the help message
--rollback Rollback a failed package
--self-manage Self management of zplug
--version Display the version of zplug
--log Show the report of zplug errors

2. Commands for zplug

Command Description Options
install Install packages in parallel (None)
load Source installed plugins and add installed commands to $PATH --verbose
list List installed packages (more specifically, view the associative array $zplugs) --select,--installed,--loaded
update Update installed packages in parallel --select,--force
check Return true if all packages are installed, false otherwise --verbose
status Check if the remote repositories are up to date --select
clean Remove repositories which are no longer managed --force,--select
clear Remove the cache file (None)
info Show the information such as the source URL and tag values for the given package (None)

Take a closer look

# zplug check returns true if all packages are installed
# Therefore, when it returns false, run zplug install
if ! zplug check; then
    zplug install
fi

# source plugins and add commands to the PATH
zplug load

# zplug check returns true if the given repository exists
if zplug check b4b4r07/enhancd; then
    # setting if enhancd is available
    export ENHANCD_FILTER=fzf-tmux
fi

Let zplug manage zplug

To manage zplug itself like other packages, write the following in your .zshrc.

zplug 'zplug/zplug', hook-build:'zplug --self-manage'

All that's left is to run zplug update.

3. Tags for zplug

truthy is any of true, yes, on, 1 and falsy is any of false, no, off, 0.

Tag Description Value (default) Example
as Specify whether to register the package as plugins or commands plugin,command,theme (plugin) as:command
use Specify the pattern of the files to source (for plugin) or the relative path to add to the $PATH (for command) / With from:gh-r, zplug tries to guess which file to use from your OS and architecture. You can manually specify use:"*darwin*{amd,386}*" if that doesn't get the right file. glob (use:"*.zsh") use:bin,use:"*.sh", use:*darwin*
ignore Similar to use tag, but specify pattern of files you want to ignore (see also #56) glob (-) ignore:"some_*.zsh"
from Specify where to get the package from github,bitbucket,
gh-r,gist,
oh-my-zsh,prezto,local (github)
from:gh-r
at Specify branch/tag/commit to install revision (master) at:v1.5.6
rename-to Specify the filename you want to rename the command to (use this only with as:command) filename (-) rename-to:fzf
dir Installed directory of the package READ ONLY dir:/path/to/user/repo
if Specify the conditions under which to install and use the package boolean (-) if:"[ -d ~/.zsh ]"
hook-build Commands to run after installation/update commands (-) hook-build:"make install"
hook-load Commands to run after loading commands (-) hook-load:"echo 'Loaded!'"
frozen Do not update unless explicitly specified truthy,falsy (false) frozen:1
on Load this package only if a different package is installed package on:user/repo
defer Defers the loading of a package. If the value is 2 or above, zplug will source the plugin after compinit (see also #26) 0..3 (0) defer:2
lazy Whether it is an autoload function or not truthy,falsy (false) lazy:true
depth The number of commits to include in the cloned repository. 0 means the whole history. Any non-negative integer depth:10

Changing the defaults

You can use zstyle to change the default value. The format is:

zstyle ":zplug:tag" tag_name new_default_value

For example, if you have a lot of commands and not so many plugins, (i.e. if you find yourself specifying as:command often), you can do:

zstyle ":zplug:tag" as command

The default value for all tags can be changed in this way.

Available on CLI

You can register packages to zplug from the command-line. If you use zplug from the command-line, it is possible to add stuff more easily with the help of powerful zsh completions.

In this case, zplug spit out its settings to $ZPLUG_LOADFILE instead of .zshrc. If you launch new zsh process, zplug load command automatically search this file and run source command.

See ZPLUG_LOADFILE for other usage of ZPLUG_LOADFILE.

4. Environment variables for zplug

ZPLUG_HOME

Defaults to ~/.zplug. zplug will store/load packages in this directory. The directory structure is shown below.

$ZPLUG_HOME
|-- bin
|   `-- some_command -> ../repos/username_A/reponame1/some_command
`-- repos
    |-- username_A
    |   |-- reponame1
    |   |   |-- README.md
    |   |   `-- some_command
    |   `-- reponame2
    |       |-- README.md
    |       `-- some_plugin.zsh
    `-- username_B
        `-- reponame1

If you specify as:command, zplug will see the package as a command and create a symbolic link of the same name (if you want to rename it, use the rename-to: tag) in $ZPLUG_BIN. Because zplug adds $ZPLUG_BIN to the $PATH, you can run that command from anywhere.

ZPLUG_THREADS

The number of threads zplug uses when installing/updating. The default value is 16.

ZPLUG_PROTOCOL

Defaults to HTTPS. Valid options are HTTPS and SSH. Unless you have a specific reason, you should use the HTTPS protocol.

For more information, see also Which remote URL should I use? - GitHub Help

ZPLUG_FILTER

Defaults to fzf-tmux:fzf:peco:percol:zaw. When --select option is specified, the first element in the colon-separated list that exists in the $PATH will be used by zplug as the interactive filter. You can also use spaces and double quotes in ZPLUG_FILTER like: fzf-tmux -d "10%":/path/to/peco:my peco.

ZPLUG_LOADFILE

Defaults to $ZPLUG_HOME/packages.zsh. This file is used to add plugins from zplug on the command-line. It is also a useful place to isolate your packages list from .zshrc. Rather than cluttering your .zshrc with many lines enumerating packages, you can put them in a separate file and set ZPLUG_LOADFILE to its path.

ZPLUG_USE_CACHE

Defaults to true. If this variable is true, zplug will use cache files to speed up the load process. The cache files are saved under the $ZPLUG_CACHE_DIR directory. If you want to clear the cache, please run zplug clear or do the following:

$ ZPLUG_USE_CACHE=false zplug load

ZPLUG_CACHE_DIR

Defaults to $ZPLUG_HOME/.cache. You can change where the cache file is saved, for example, ~/.cache/zplug.

ZPLUG_REPOS

Defaults to $ZPLUG_HOME/repos. You can change where the repositories are cloned in case you want to manage them separately.

ZPLUG_SUDO_PASSWORD

Defaults to ''. You can set sudo password for zplug's hook-build tag. However, this variable should not be managed in dotfiles and so on.

ZPLUG_LOG_LOAD_SUCCESS

Defaults to false. If true, zplug spit the log about its success operation out to file (you can see it with zplug --log).

ZPLUG_LOG_LOAD_FAILURE

Defaults to false. If true, zplug spit the log about its failure operation out to file (you can see it with zplug --log).

# your .zshrc
source ~/.zshrc_secret
zplug "some/command", hook-build:"make && sudo make install"

ZPLUG_BIN

Defaults to $ZPLUG_HOME/bin. You can change the save destination of the command's symbolic link, e.g. ~/bin.

External commands

zplug, like git(1), supports external commands. These are executable scripts that reside somewhere in the PATH, named zplug-cmdname, which can be invoked with zplug cmdname. This allows you to create your own commands without modifying zplug's internals. Instructions for creating your own commands can be found in the docs. Check out the sample zplug-env external command for an example.

V.S.

zplug is the fastest among the famous zsh plugin managers. Numbers? Here they are:

Note

  • Not antigen 💉 but zplug 🌺 will be here for you from now on.
  • 🌺 It was heavily inspired by vim-plug, neobundle.vim and the like.

Other resources

awesome-zsh-plugins is a list of ZSH plugins, themes and completions that you can use with zplug.

For migration from antigen, zgen, or zplug v1, check out the wiki page.

License

MIT (c) @b4b4r07

zplug's People

Contributors

39e avatar agross avatar akatrevorjay avatar b4b4r07 avatar babarot avatar bootleq avatar crahan avatar defman21 avatar derimagia avatar draftcode avatar iladin avatar john-wick-ksg avatar kepbod avatar leomao avatar matsubo avatar nigorojr avatar nmiculinic avatar okuramasafumi avatar paulomcnally avatar philipsd6 avatar raviqqe avatar sachin21 avatar shvenkat avatar sigma avatar ubnt-intrepid avatar unixorn avatar yous avatar ywatase avatar znd4 avatar zplug-man avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zplug's Issues

Syntax error when plugin name starts with "as"

Test ~/.zshrc:

source ~/.zplug/zplug

zplug "ascii-soup/zsh-url-highlighter"

if ! zplug check --verbose; then
    printf "Install? [y/N]: "
    if read -q; then
        echo; zplug install
    fi
fi

zplug load

Error message:

[zplug] #syntax error# tag 'as:' takes ['command','plugin'] (zplug "ascii-soup/zsh-url-highlighter")

Expected:

- ascii-soup/zsh-url-highlighter: not installed
Install? [y/N]: _

Manual sourcing of .zshrc reports errors

If I start a new shell, all is fine, however if I source ~/.zshrc afterwards I get i.e. these strange errors:

5:45:12 6d [felix:~] % source ~/.zshrc
b4b4r07/enhancd,
of:enhancd.sh: must be put one or more spaces after comma
plugins/git,
from:oh-my-zsh: must be put one or more spaces after comma
plugins/vi-mode,
from:oh-my-zsh: must be put one or more spaces after comma
hchbaw/opp.zsh,
of:opp.zsh: must be put one or more spaces after comma

The file that was loaded is here: https://github.com/felixSchl/dotfiles/blob/master/zsh/.zshrc

completion not working after #24

The last line of my static.zplug reads: fpath=("/home/asymmetric/.zplug/repos/robbyrussell/oh-my-zsh/plugins/mix" $fpath).

Trouble is completion doesn't work anymore.

Migration question

Hi there,

I'm migrating my zsh config from my own setup to zplug. I have my completion settings in a specific file that I was sourcing myself before. Above the settings, there is this piece of code:

(Source)

autoload -U compinit

# Ignore insecure directories.
compinit -u

My question is, should I remove it and have zplug call compinit? I'm using zplug "zsh-users/zsh-syntax-highlighting", nice:10 as well and I read that there were some requirements w.r.t. to load order.

I also would love to know your stance on file organization. I like to keep my settings grouped in ~/.zsh/config/ and ~/.zsh/lib/:

  • ~/.zsh/config/ contains plugin config (e.g. SSH forwarding) that needs to be loaded before zplug "plugins/ssh-agent", from:oh-my-zsh.
  • The files in ~/.zsh/lib/ contain my settings that may overwrite some defaults from oh-my-zsh for example.

Do you think defining nice:something is the best way to handle this? As far as I can see plugin load order is only determined by the nice tag.

Thanks,

Alex

zplug external file (on CLI solution)

zplug でコマンドラインからプラグイン追加したい
I want to add plugins or commands on CLI

something like this

$ zplug "b4b4r07/enhancd", of:"zsh/*.zsh"

現状、上のように CLI で叩いても 連想配列 zplugs でプラグイン名とその属性(as:cmd,of:bin/hoge など)を保持しているため、シェルを切り替えるとその情報が失われる。

そのため、コマンドラインから zplug "username/reponame" されたとき外部ファイルに書き出すようにして、シェルを切り替えても zplug で拾えるようにしたい。

外部ファイルに書き出す機能は環境変数で有効・無効にできると良い。

Emacs keybindings not working

With zplug installed, I can no longer rely on Emacs keybingings, like CTRL-a, CTRL-e and the like.

This wasn't an issue with antigen. Was antigen configuring something that is left to the user to configure with zplug? If so, it might be a good idea to document this.

Cannot get oh-my-zsh completion plugins to work

I'm trying to get completions for several oh-my-zsh plugins, but can't get the completions to work.

I use the following line to install/configure vagrant for example:

zplug "plugins/vagrant", from:oh-my-zsh, nice:10

Which works fine in terms of installing, but I get no auto completion when entering vagrant <tab>

I tried playing with nice values and removing them, but it doesn't work.

Showing git output when updating

Hi @b4b4r07 ,

zgen shows the output of git pull when updating, which I find useful to give an idea of what/how much has changed in each plugin.

Could it be possible to do the same, maybe with the addition of a --verbose flag to update?

Problems with tmux / reattach-to-user-namespace

I have been using antigen for a while now and am looking for a faster alternative. zgen crossed my way before zplug, so I gave that a shot but I had problems using it in conjunction with tmux and reattach-to-user-namespace. The details are reported on the zgen repo. However, I have not received any answer on the zgen issue tracker and zplug looks like a promising project with more active development, so I figured it made sense to open the issue here as well.

To summarise:

When I use the reattach-to-user-namespace utility for tmux in order for my clipboard to work in conjunction with zsh, new panes would close immediately upon creation and closing an existing pane would sometimes close all panes in a cascading effect.

I hope this can be fixed, I am very much looking forward to using zplug

[FreeBSD] error with sleep

Hi,

on freebsd launching "zplug status" or "zplug update" show a flood of "usage: sleep seconds" in console

Thanks for zplug

Mix plugin from Oh-my-Zsh not working

mix is the build tool of the Elixir programming language.

The mix plugin from oh-my-zsh doesn't seem to work in zplug. I tried zplug "plugins/mix" from:oh-my-zsh.

Do I have to specify an of option, like I had to do for rupa/z? In general, when is the of option necessary? I think the README/wiki could use some further explaination on this.

Thanks for the alreday gret tool! 👏

Order of arguments matter?

I had a line in my .zshrc:

zplug "plugins/tmuxinator", from:oh-my-zsh, if: "[[ -x $(command -v tmuxinator) ]]"

and it seemed to fail locating the plugin, unless I changed the order of the arguments (if first, then from).

Is this a known issue?

[Question] dependency: installation or loading?

I have a question about the dependency expressed with the pipe |. Does this represent the order in which plugins are installed or loaded (or both)?

If it's not just for installation, there may be a bug. Following are the steps to reproduce.

Steps to Reproduce

Directory structure

~/tmp
|-- plugin_a
|   `-- a.zsh
`-- plugin_b
    `-- b.zsh

with

a.zsh

echo 'plugin a'

b.zsh

echo 'plugin b'

.zshrc (essential parts)

zplug '~/tmp/plugin_a', from:local \
        | zplug '~/tmp/plugin_b', from:local

When I start a new shell or zplug load --verbose, it prints out:

~/tmp/plugin_b: (not loaded)
plugin a

I wasn't sure if this is a bug or a feature because it would make sense to express the installation dependencies with the pipes and loading dependencies with the niceness, but wanted to make sure.

Load theme from Gist

I'm trying to load this theme, but it doesn't seem to be working, i.e. the prompt doesn't change.

I'm loading it with zplug load "asymmetric/56ccdf015e1a3b4c4fbd", from:gist, of:asymmetric.zsh-theme.

By the way, is the of: option mandatory when using from:gist?

New features (TBD)

zplug v2.0.0 specifications

  • New project directory
    • consists of multiple files
    • autoload (__subcommand__ file)
  • External commands like git(1)
  • Test
    • use zspec as testing framework
    • tests for each files
    • integration testing
  • Documentation (man pages)
  • Rename tags (TBD)
    • as => type
    • of => use
    • file => rename / as
    • ...
  • Notification
    • AppleScript, terminal-notifier (OS X)
    • notify-send (GNU/Linux)
  • Lazy loading

Implement update command

Update all plugins in parallel

$ zplug update           # plugins/commands are updated
$ zplug update --self    # update zplug

and implement frozen: specifier (e.g., vim-plug) "Do not update unless explicitly specified"

Provide support for local custom plugins/themes using oh-my-zsh

Hi, oh-my-zsh provides a features to develop plugins or themes to put it in a custom folder with the following structure $OHMYZSH_REPO/custom/themes/something.zsh-theme. I want to use these feature with zplug.

I saw in the code that the parsers (__zsh::parser) identifies the oh-my-zsh repo and reads the name in zspec[name] to use a subpath like "plugins/", "themes/" and "lib/*". I tried to add "custom/themes" there so that can be appended in "dir:" and can be loaded, but it doesn't work. For example, if I put the if block with the "custom/themes" and in zshrc put something like:

zplug "custom/themes/infostrip" from:oh-my-zsh

It throws an error saying that infostrip was not found as a command. Then this request is for:

  1. Provide a way to load a plugin/theme/lib using a local directory or maybe local git repo.
  2. Provide the functionality of loading a custom/{plugin,theme,lib} using oh-my-zsh

I think I can do the changes and do a PR, but I need some guidance in what to change and the dependencies.

zplug update prints "Not updated" in an inconsistent manner

From machine A on my local network:

$ zplug update
Updating...  zsh-users/zsh-syntax-highlighting
Updating...  rhysd/zsh-bundle-exec
Updating...  b4b4r07/zplug
Updating...  bobthecow/git-flow-completion
Updating...  plugins/ssh-agent
Updating...  holman/dotfiles
Not Updated  b4b4r07/zplug                      (0.48s)
Not Updated  plugins/ssh-agent                  (0.78s)
Updated!     rhysd/zsh-bundle-exec              (5.84s)
Updated!     zsh-users/zsh-syntax-highlighting  (5.97s)
Updated!     bobthecow/git-flow-completion      (6.01s)
Updated!     holman/dotfiles                    (5.99s)

From machine B on my local network:

$ zplug update
Updating...  rhysd/zsh-bundle-exec
Updating...  zsh-users/zsh-syntax-highlighting
Updating...  agross/rapid-git
Updating...  b4b4r07/zplug
Updating...  bobthecow/git-flow-completion
Updating...  plugins/ssh-agent
Updating...  holman/dotfiles
Not Updated  agross/rapid-git                   (0.30s)
Not Updated  bobthecow/git-flow-completion      (0.27s)
Not Updated  rhysd/zsh-bundle-exec              (0.36s)
Not Updated  zsh-users/zsh-syntax-highlighting  (0.47s)
Not Updated  holman/dotfiles                    (0.40s)
Not Updated  b4b4r07/zplug                      (1.35s)
Not Updated  plugins/ssh-agent                  (2.08s)

I ran these several times, always with the same result. What does it mean that a repo was "Not updated"? Did an error happen? Are there no updates available?

If the latter is true, why would machine A always print that some repos were updated?

Most Oh-my-ZSH themes not working

If I try to source OHMYZSH's default theme with zplug "themes/robbyrussell", from:oh-my-zsh , this is what I get in my prompt:
image

This happens with most themes, but not with the one mentioned in the README, duellj.

I'm using Gnome Terminal on Linux, zsh 5.1.1

Symlinks not removed with zplug clean

Description

Dead symbolic links are left in $ZPLUG_HOME/bin after cleaning unused plugins with zplug clean.

Steps to reproduce

$ zplug tj/n, as:command, of:bin/n
$ zplug install
$ zplug load
$ ls -l $ZPLUG_HOME/bin/n
# Remove from $ZPLUG_EXTERNAL
$ sed -i'' '$d' $ZPLUG_EXTERNAL
# Now, launch a new zsh process
$ exec zsh
$ zplug clean
$ ls -l $ZPLUG_HOME/bin/n

After the last command, it shows that n is not linked. This also happens when simply running zplug clean tj/n to manually remove a plugin.

Support autoload like Vim

New feature Lazy loading by builtin autoload command like NeoBundle in Vim

zplug "foo/bar", as:plugin, lazy:1

If 1 is set in the lazy tag, zplug will do lazy loading. (value is 1/true/"{some,file}"...Undecided)

When zplug do lazy loading, autoload directory is created in ~/.zplug/autoload and files would be delayed loading are linked to the directory as symbolic link.

$ ls -l ~/.zplug/autoload
total 16
lrwxr-xr-x  1 b4b4r07  staff  52 Dec 11 15:11 bar -> /Users/b4b4r07/.zplug/repos/foo/bar/bar
lrwxr-xr-x  1 b4b4r07  staff  53 Dec 11 15:11 qux -> /Users/b4b4r07/.zplug/repos/baz/qux/directory/qux

Implement check command

NeoBundleCheck-ish command

usage:

  • case1:
if zplug check; then
  zplug install
fi
zplug load
  • case2
$ zplug check --verbose
- b4b4r07/zsh-gomi: not installed
$ echo $status
0
$ zplug install; zplug check
$ echo $status
1
$ zplug check --verbose
All plugins are installed and managed (...)

oh-my-zsh plugins show that installation failed

For example, when using, yet again 😏,

zplug 'plugins/golang', \
    from:oh-my-zsh, \
    ignore:oh-my-zsh.sh, \
    nice: 10

zplug uses plugins/golang as the username/repo when installing or showing the status.

When running zplug status:

...
(not init) [plugins/golang] (? -> ?/?) URL: ?
...

This is due to $line directly being used here (at least for the installation problem) when it should be prefixed with robbyrussell/oh-my-zsh.

git version on OS X is not correctly parsed

This is an error received every time the git version is compared in zplug:
__version_requirement:14: bad math expression: operator expected atGit-60)'`

git --version
git version 2.4.9 (Apple Git-60)

I will create a simple PR which fixes it but maybe you have a different approach to fix this.

Multiple of: patterns from same path

I'm trying to achieve the same that Zach Holman did for his dotfiles: Zach's zsh loads different files from the same directory filtered by patterns.

# Load paths first.
zplug "$DOTFILES", from:local, nice:-20, of:"**/path.zsh"

# Load everything but the path and completion files second.
zplug "$DOTFILES", from:local, nice:-19, of:"**/{path,completion}.zsh" # Pattern is broken.

# Load every completion after compinit was run.
zplug "$DOTFILES", from:local, nice:10, of:"**/completion.zsh"

It seems that zplug uses $DOTFILES as a hash key, so the second zplug overwrites the first and the third zplug overwrites the second:

$ zplug list
/home/agross/.dotfiles  =>  from:local, nice:10, of:**/completion.zsh, dir:/home/agross/.dotfiles

While we're at it: Any idea how to include everything but path.zsh and completion.zsh?

zplug "$DOTFILES", from:local, nice:-19, of:"**/{path,completion}.zsh" # Doesn't currently work.

Thanks!

Code size

Not meant to be a critique (I find your project amazing!), but what is the reason for zplug being almost 2000 SLOCs, whereas zgen clocks in at ~500?

What are the features/options that are taking the most space, and where do you think there is room for optimization?

only need to call compinit once

Hi,
I found that in the function __zplug::load, it calls compinit for each key.
This slow down the startup process significantly.
I think we only need to call compinit once after loading all plugins?

BTW, I found that zsh-syntax-highlighting should be loaded after loading all other plugins and compinit.
But it seems that there is no way to accomplish it.

Help loading a prezto theme(iggy)

Happy holidays and thank you for creating such a wonderful tool!

I am trying to load a theme called iggy
It depends on some prezto modules(helper/git) which I loaded in my zshrc

The issue is the prompt is not being rendered correctly. Am not sure what the issue is but I don't think it's to do with the fonts as I have powerline patched fonts which work fine with a oh-my-zsh them bulletrain as seen here

I also tried displaying the icons it uses in the prompt in the terminal and they appear fine

With the zshrc I posted above I get this error which I assume is to do with the prezto framework not being loaded up as when I comment out the "pmodload 'helper'" line from the theme and the error goes away.

I wanted to try and add prezto support like in zgen here - m42e/zgen@b7e0660 but my programming knowledge/skills is very limited atm 😢

I also tried using a suggestion found on antigen's issue tracker but with no luck - zsh-users/antigen#137

Thanks for you time and work.

Startup time

So, I've switched from zgen to zplug and the cached startup times are noticeably slower.

I profiled my ~/.zshrc with the zprof module, and the results are here (best out of 5).

This seems mostly due to calling zplug load over and over (yes, I have ~50 zsh plugins):

num  calls                time                       self            name
-----------------------------------------------------------------------------------
 1)   52        2076.13    39.93   59.38%   2076.13    39.93   59.38%  __zplug::validator
 8)   54        3193.69    59.14   91.35%     16.00     0.30    0.46%  zplug

My goal is to short-circuit this by loading ~/.zplug/.cache if it exists, but these lines are a problem:

# ~/.zplug/.cache
if [[ $_zplug_repos != $_zplug_saved ]]; then
  ZPLUG_USE_CACHE=false zplug load --verbose
  return $status
fi
  • If I remove them and source the file, all plugins are loaded perfectly.
  • If I source the file as-is, nothing useful happens and the file is rewritten with no plugins.

In short, I would like to mimic the following zgen functionality:

if ! zgen saved; then
    # ^ this line loads all the plugins from cache

    # otherwise, 50 invocations of `zgen load` happen here.
fi

I am more than happy to zplug clear --force (analogous to zgen reset) each time I change ~/.zshrc if it saves me 2-3 seconds on each shell.

As I understand it, this is what you are trying to avoid (typing zplug clear), so two questions:

  1. Can it be possible to opt-in to the behavior I'm looking (where you have to manually zplug clear)?
  2. Perhaps a faster way to perform this "diff" (e.g. postponing __zplug::validator calls until later)?

Hopefully I'm not missing something and this is already possible. Thoughts?

Theme won't load from:local

I have a customized theme which I placed in .zplug/themes/my-theme.zsh-theme.

My .zshrc looks like this:

source ~/.zplug/zplug

zplug "robbyrussell/oh-my-zsh", of:oh-my-zsh.sh, nice:-10
zplug "plugins/colorize", from:oh-my-zsh
# more oh-my-zsh plugins
zplug "plugins/z", from:oh-my-zsh
zplug "themes/my-theme", from:local

if ! zplug check --verbose; then
  printf "Install? [y/N]: "
  if read -q; then
    echo; zplug install
  fi
fi

zplug load

I have tried various different paths, like ~/.zplug/themes/mytheme, themes/mytheme.zsh-theme, and adding of:"*.zsh-theme, adding nice:10 and adding as:plugin, in various combinations.

The only way I could load the theme was copying it to repos/robyrussell/oh-my-zsh/themes and loading it like a stock oh-my-zsh theme.

What's the proper way to apply a local theme?

Cheers
Veit

history-substring-search plugin from oh-my-zsh closes session

Hi there!

The history-substring-search plugin from oh-my-zsh closes my terminal session. The last thing I can observe is that it clones the original zsh-history-substring-search plugin. I know I could use that directly, but the OMZ version changes the background color of the search term, which is why I want to use that substring-search plugin.

Here is how I try to activate the plugin:

zplug "plugins/history-substring-search",   from:oh-my-zsh

Here is a Screenshot of the last thing happening. Here I tried to load the original (ZSH one) substring search plugin in advance, but also without that the error persists.
bildschirmfoto 2015-12-02 um 21 43 22

Thank you very much.

Support bitbucket

$ zplug "user/repo", as:plugin, from:github     # default from:github
$ zplug "user/repo", as:plugin, from:bitbucket

Install as a git submodule: breaks index. Adding .gitignore helps

I'm managing my whole ~, and I've installed zplug as:

git submodule add https://github.com/b4b4r07/zplug.git .zplug

Added appropriate lines to .zshrc, including
After zplug install git starts being annoying:

$ git status
On branch master
Changes not staged for commit:
    modified:   .zplug (untracked content)

This doesn't appear anymore if I add .gitignore to ~/.zplug:

.cache
.gitignore
repos
zcompdump

Full dotfiles just for the case.

The rest is just brilliant! Great job

zsh-users/zsh-syntax-highlighting should be loaded at the end

As metion in #24, zsh-syntax-highlighting should be loaded after loading all other plugins and compinit in order to update the syntax highlighting properly.

I am not sure whether this issue is only for zsh-syntax-highlighting or not.
If other plugins also wrap ZLE widget, then they may also need to be loaded in some order to work properly together.

Oh-my-Zsh functions leaking

Hi,

I have zplug "plugins/mix", from:oh-my-zsh in my ~/.zshrc, which to me basically means that I only want the mix plugin from OMZ, not everything that comes with it.

But I noticed that in my shell the function upgrade_oh_my_zsh, taken from lib/functions is defined. I definitely don't want to let OMZ update itself, since I'm using the much lovelier zplug :)

Is there a way not to let OMZ define this particular function, or any function at all?

Re-design cache system

Some problems occurred.

  • Cannot detect tag changes
  • Segfault when executing expand-or-complete (it is not related to zplug)
  • ..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.