oh-my-zsh ā
š Installation ā
- You'll needĀ
zsh
Ā to installĀ Oh My Zsh. RunĀzsh --version
Ā to check if you have it:
shell
$ zsh --version
zsh 5.8 (x86_64-ubuntu-linux-gnu)
If you seeĀ command not found
Ā you don't have zsh installed. SeeĀ Installing ZshĀ for instructions.
shell
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
NOTE: the installer will rename an existingĀ .zshrc
Ā file toĀ .zshrc.pre-oh-my-zsh
.
šØ Theme Installation ā
Powerlevel10k ā
Powerlevel10k is the most versatile theme on market which can be rich and minimalistic at the same time. To install it use below command
- Clone the repository:
shell
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
- SetĀ
ZSH_THEME="powerlevel10k/powerlevel10k"
Ā inĀ~/.zshrc
. - Run
omz reload
in terminal.
Theme Powerlevel10K
Configuration ā
To configure Powelevel10K
, type p10k configure
Starship - cross-shell prompt ā
If you are a person, who does not want to get into theme setup rabbit hole, then Starship is for you. It is simple to install and setup. Starship also provide presents.
Installation & Configuration ā
- Homebrew install
shell
brew install starship
- Open zsh config and add below line at the very end of
.zsh
file.
eval "$(starship init zsh)"
- Presets | Starship. One simple step to install preset.
shell
starship preset nerd-font-symbols -o ~/.config/starship.toml
- If you still want more customisation, then simply modify
~/.config/starship.toml
.
ā Useful Plugins ā
- Clone plugin to
~/.oh-my-zsh/custom}/plugins
directory
shell
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
- Once cloned, add it to
.zshrc
file
shell
code ~/zshrc
- Add plugin snippet
zshrc
plugins=(
...other plugin...
zsh-autosuggestions
)
source $ZSH/oh-my-zsh.sh
- Save
.zshrc
and exit the editor - In order to activate the changes we need to reload the
.zshrc
shell
omz reload
Here are some cool plugin I use the most
- git
- dotenv
- zsh-autosuggestions
- f-sy-h More plugin can be find here.
šCheat Sheet ā
Quick reference:
- Oh My Zsh's Command-Line Interface (CLI):Ā
omz
. RunĀomz --help
Ā for available commands. - ToĀ updateĀ Oh My Zsh:Ā
omz update
. - ToĀ uninstallĀ it:Ā
uninstall_oh_my_zsh
. - To apply changes made toĀ
.zshrc
:Āomz reload
Ā (this just runsĀexec zsh
).Ā Do NOT runĀsource ~/.zshrc
.
Commands ā
Command | Description |
---|---|
alias | List all aliases |
mkcd | Create a new directory and change to it, will create intermediate directories as required. |
take | LikeĀ mkcd , but also knows how to handle remote URLs. When given an argument that looks like a URL (something that ends inĀ .git Ā orĀ .tar.(gz|bz2|xz) ), download the remote resource and extract it (if necessary) into the current directory. Then change to the newly extracted/downloaded/cloned directory. |
zsh_stats | Get a list of the top 20 commands and how many times they have been run. |
Directory ā
Alias | Command |
---|---|
md | mkdir -p |
rd | rmdir |
cd Ā /Ā ~ | cd Ā to your home directory |
.. | cd .. |
... | cd ../.. |
.... | cd ../../.. |
..... | cd ../../../.. |
/ | cd / |
d | dirs -v Ā (lists last visited directories) |
cd +n | Switch to directory numberĀ n |
- | cd Ā to last visited directory |
1 | cd -1 |
2 | cd -2 |
3 | cd -3 |
4 | cd -4 |
5 | cd -5 |
6 | cd -6 |
7 | cd -7 |
8 | cd -8 |
9 | cd -9 |