ZSH Tools
0. Confirm Zsh Availability
If not available:
xywu3@hszhao-gate:~$ zsh
Command 'zsh' not found, but can be installed with:
apt install zsh
Please ask your administrator.
1. install Oh My Zsh!
# github repo: https://github.com/ohmyzsh/ohmyzsh
# curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# or wget
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# or fetch
sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# key components of oh-my-zsh
➜ ~ cd ~/ && ls -al
.zshrc
.oh-my-zsh
...
2. Install Plugins
cd ~/.oh-my-zsh/custom/plugins
# zsh autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions.git
# zsh syntax highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
# modify ~/.zshrc as follow
vim ~/.zshrc
# search `plugins=`
# replace the line with `plugins=(sudo z history zsh-syntax-highlighting zsh-autosuggestions extract)`
# btw change the theme, my favorite is "af-magic"
# search `ZSH_THEME=`
# replace the line with `"ZSH_THEME="af-magic"`
sudo
: double clickesc
to addsudo
before input command.z
: jump quickly to directories that you have visited frequently in the past, or recently.history
: browse previous command.zsh-syntax-highlighting
: highlight commant.zsh-autosuggestions
: suggest command with given prefix, press➜
to adopt and press↑
to browse.extract
: addx
before any zipped file to unzip.