Additional completion definitions for Cleos. Complete your cleos with zsh completion! 🎉
cleos-zsh-completion is additional completion for cleos. It provides the short description about each command and auto-complete with your tab/arrow keys.
Use cleos with your tab key or ↑ ↓ arrow keys.
- Install zsh and zsh-completions
- Install cleos-zsh-completion
- Reload
You can use it with zsh and zsh-completions.
If you're already use Oh My Zsh and zsh-completions, try below:
curl -fLo ~/.oh-my-zsh/custom/plugins/zsh-completions/src/_cleos https://raw.githubusercontent.com/OWDIN/cleos-zsh-completion/master/_cleos
If not, Install Oh My Zsh and zsh-completions.
# Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# Install zsh-completions
git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions
You should configure zsh-completions.
If you're not familiar with zsh, just type below:
# Configuration for newbie.
# If you already use zsh, check https://github.com/zsh-users/zsh-completions#oh-my-zsh
echo "plugins=(zsh-completions)" >> $HOME/.zshrc
echo "autoload -U compinit && compinit" >> $HOME/.zshrc
echo "fpath=($HOME/.oh-my-zsh/src $fpath)" >> $HOME/.zshrc
Download cleos completion and reload it. Done!
# Download cleos completion
curl -fLo ~/.oh-my-zsh/custom/plugins/zsh-completions/src/_cleos https://raw.githubusercontent.com/OWDIN/cleos-zsh-completion/master/_cleos
# Reload shell
source $HOME/.zshrc
If you want to see full version of configuration, check my dotfiles.
You should add below options for help messages. If not, you cannot see yellow help messages. If you don't want to see yellow extra help message, remove zstyle ':completion:*:messages' format $'\e[00;33m%d'
options.
# Add this in .zshrc
zstyle ':completion:*' verbose yes
zstyle ':completion:*' group-name ''
zstyle ':completion:*:descriptions' format $'\e[00;32m%d'
zstyle ':completion:*:messages' format $'\e[00;33m%d'
zstyle ':completion:*:manuals' separate-sections true
If you're not familiar with zsh, just type below:
# for newbie
echo "zstyle ':completion:*' verbose yes" >> $HOME/.zshrc
echo "zstyle ':completion:*' group-name ''" >> $HOME/.zshrc
echo "zstyle ':completion:*:descriptions' format $'\e[00;32m%d'" >> $HOME/.zshrc
echo "zstyle ':completion:*:messages' format $'\e[00;33m%d'" >> $HOME/.zshrc
echo "zstyle ':completion:*:manuals' separate-sections true" >> $HOME/.zshrc
If you're use customized cleos like cleos_docker, edit _cleos first line like below:
- #compdef cleos
+ #compdef cleos cleos_docker=cleos
..or You can also use without edit file like below:
compdef _cleos cleos cleos2 cleos3
- CHANN - @channprj
This project is licensed under the MIT License. See LICENSE for more detail.
- EOS.io - Cleos Overview
- ZSH - Completion System
man zshcompsys