Skip to content

ZSH

Plugins

zsh plugin managers

zinit

Install:

https://github.com/zdharma/zinit#option-2---manual-installation

git clone https://github.com/zdharma/zinit.git ~/.zinit/bin

Usage:

Other options

Deprecated

Alternative config dir

$ cat .zshenv
export ZDOTDIR=~/.config/zsh

ZSH completion

Create/update completions in $ZDOTDIR/completion:

~/bin/custom/zsh_create_completions.sh

http://zsh.sourceforge.net/Doc/Release/Completion-System.html http://zsh.sourceforge.net/Guide/zshguide06.html

man zshcompsys

For active system-wide completions see

  • /usr/share/zsh/functions/Completion/
  • /usr/share/zsh/site-functions/
  • and custom ones at ~/.zsh/completion/

https://github.com/zsh-users/zsh-completions

Bash completetion compatibility

https://stackoverflow.com/a/8492043

Profiling zsh startup time

Measure time:

$ time  zsh -i -c exit
Before: 2,05s user 0,46s system 95% cpu 2,624 total

Start verbose:

zsh -xv

Show zprof profile stats (needs to get enabled on top of .zshrc)

zprof

Colors

Zsh color codes

echo "$(tput setaf 1)~~> Red $(tput sgr0)"

Nvim zsh support