Skip to content

OWDIN/cleos-zsh-completion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cleos-zsh-completion

Additional completion definitions for Cleos. Complete your cleos with zsh completion! 🎉

Demo

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. ☺️

How to Install

  1. Install zsh and zsh-completions
  2. Install cleos-zsh-completion
  3. 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.

Recommanded Configuration

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

Use with customized cleos

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

Authors

License

This project is licensed under the MIT License. See LICENSE for more detail.

Reference

Releases

No releases published

Packages

No packages published

Languages