Rick Cogley's Tech Logr

Short Technical Laser Bursts %%

RC Logr 20200706 060711

Monday, 6 Jul, 2020

Trying a different zsh plugin system, «zplug». It is super simple and flexible, and I am testing out «liquidprompt» prompt with it (morphy goodness). So far I like this combo a lot. 🤩

You install zplug like this:

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

Enable and configure it in your ~/.zshrc using some of the examples provided:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Source zplug
source ~/.zplug/init.zsh

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

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

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

# Liquidprompt
zplug "nojhan/liquidprompt"

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

# 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

# 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

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

Except for liquidprompt, those are just copy-pasted from the docs. Then restart your terminal and answer the install prompts to install the plugins. Sweet zsh goodness. Thanks to Masaki Ishiyama for coding up a great system https://twitter.com/b4b4r07.

liquidprompt screenshot

RC Logr 20200706 060711 - Trying a different zsh plugin … Rick Cogley
Back to Home Tweet Link