My Zsh Config
My personal config for Zsh (Z Shell), noting for next time.
Installation
Windows
Helpful resources:
Linux
Use your favorite package manager to install zsh
and then run chsh -s $(which zsh)
to set Z Shell as your default shell.
Mac
It's installed by default.
Themes and Plugins
Firstly, install oh-my-zsh and powerlevel10k.
1 | # installs oh-my-zsh using curl |
Then, to set powerlevel10k
as the theme, edit in ~/.zshrc
:
1 | ZSH_THEME="powerlevel10k/powerlevel10k" |
Plugins
Oh-my-zsh provides many plugins (See the list), and you can install more by yourself.
I installed some plugins not provided by oh-my-zsh:
1 | git clone https://github.com/esc/conda-zsh-completion ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/conda-zsh-completion |
Edit in ~/.zshrc
:
1 | plugins=( |
Usage of some plugins:
git
: GitHub
Alias | Command |
---|---|
g | git |
ga | git add |
gaa | git add --all |
gapa | git add --patch |
gau | git add --update |
gav | git add --verbose |
gb | git branch |
gco | git checkout |
gcl | git clone --recurse-submodules |
gcam | git commit --all --message |
gc | git commit --verbose |
gc! | git commit --verbose --amend |
gd | git diff |
gf | git fetch |
glog | git log --oneline --decorate --graph |
gl | git pull |
gp | git push |
gst | git status |
gss | git status --short |
... | ... |
git-commit
: GitHub
Syntax: git <type> [(-s, --scope) "<scope>"] "<message>"
, where <type>
is:
build
chore
ci
docs
feat
fix
perf
refactor
rev
style
test
NOTE: the alias for revert
type is rev
, as otherwise it conflicts with the git command of the same name.
It will still generate a commit message in the format revert: <message>
Alias | Command |
---|---|
git style "remove trailing whitespace" | git commit -m "style: remove trailing whitespace" |
git fix -s "router" "correct redirect link" | git commit -m "fix(router): correct redirect link" |