Skip to content
GradedJestRisk edited this page Mar 17, 2021 · 16 revisions

Table of Contents

General

List:

  • first release 1990, the name zsh derives from the name of Yale professor Zhong Shao (then a teaching assistant at Princeton University) — Paul Falstad regarded Shao's login-id, "zsh", as a good name for a shell.
  • Shortcuts

Install

sudo apt-get install zsh

plugin

List:

curl -o $HOME/scripts/z.sh https://raw.githubusercontent.com/rupa/z/master/z.sh && echo '. $HOME/scripts/z.sh' >> .zshrc && zsh
    • use
      • cd around: cd /tmp && cd $HOME && cd /usr
      • Ignore message _z_dirs:2: no such file or directory: /home/topi/.z
      • now try z tm and hit complete, will autocomplete to z /tmp

install

Oh my zsh

List:

  • install: $ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  • Cheatsheet
  • upgrade manually: upgrade_oh_my_zsh
  • remove one alias : edit ~/.zshrc and add unalias after source
source $ZSH/oh-my-zsh.sh
unalias gpf!

plugin

Choose here

Edit .zshrc to set plugins variable before loading oh-my-zsh

# Select plugins
plugins=(git)
plugins+=(zsh-nvm)

source $ZSH/oh-my-zsh.sh

# Undefine dangerous aliases
unalias gpf!

# Redefine aliases
alias npmI='npm init --yes'

Reload all zsh

theme

|https://github.com/ohmyzsh/ohmyzsh/wiki/Themes An overview by screenshots]

A selection

Built-in

Steps:

  • list
  • update ZSH_THEME="<theme_name></theme_name>"

Custom

Steps:

  • cd ~/.oh-my-zsh/custom/themes
  • git clone
  • vi ~/.zshrc
  • update ZSH_THEME="<theme_name></theme_name>"
  • zsh

git status =

To dig:

  • https://blog.carbonfive.com/writing-zsh-themes-a-quickref/
  • https://github.com/ohmyzsh/ohmyzsh/blob/76c7bd57c332b3d9231dc2c6167f3c5d3e56e110/lib/git.zsh
  • https://koerbitz.me/posts/Let-Your-Prompt-Tell-You-When-To-Pull.html
  • https://gist.github.com/vergenzt/33a45a9a9218b38bd4bf
Clone this wiki locally