Make your terminal looks like better. A collection of console terminal in serveral operation system.
In this note, I used iTerm2 for MacOS. If you use windows, you can use Windows Terminal + WSL
1sudo apt install zsh
1# check installed
2zsh --version
3
4# make zsh to default bash
5chsh -s $(which zsh) # need to logout and login again
6
7# check
8echo $SHELL # /bin/zsh
From MacOS Catalina (10.15), ZSH became the default Terminal and has remained the default in subsequent release
1# Install oh my zsh
2sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
After install plugins (choose options install with oh my zsh), put theme in
~/.zshrc
1# example (for me only)
2plugins=(git zsh-autosuggestion zsh-syntax-highlighting z docker docker-compose npm)
Install Nerd Font (It provides for programing high number icons)
Installation themes (for iTerm2 + Terminal MacOS)
- Download and install theme
My theme customization: Github Repository
- Open iTerm2 → Preferences → Profile → Color
- Color presets → Imports
- Choose file
*.itermcolors
downloaded in step 1
- Change theme to new theme is imported
Install theme powerlevel10k
1git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Change zsh theme to “powerlevel10k”
1# OPEN ~/.zshrc
2ZSH_THEME="powerlevel10k/powerlevel10k"
Sometimes you may encounter commands that are too long than necessary. Typing out such commands can become time-consuming and inefficient, especially if you regularly use the command. That’s where command aliases come into play
ZSH aliases are configuration
~/.zshrc
. The general syntax for the ZSH alias is1alias <flag> <alias_name>="<command>"
1alias gs="git status"
2alias ga="git add"
3alias gpl="git pull"
4alias gph="git push"
1autoload -Uz compinit && compinit
Zinit is a flexible and fast Zshell plugin manager that will allow you to install everything from GitHub and other sites.
- Installation zinit
1# .zshrc
2ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
3# Download Zinit, if it's not there yet
4if [ ! -d "$ZINIT_HOME" ]; then
5 mkdir -p "$(dirname $ZINIT_HOME)"
6 git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
7fi
Install plugins
1zinit light <plugin-name>
2
3# example
4
5# install ohmyzsh
6zinit light ohmyzsh/ohmyzsh
7
8# install p10k theme
9zinit ice depth=1; zinit light romkatv/powerlevel10k
10
11# install
12zinit light zsh-users/zsh-completions
13zinit light zsh-users/zsh-autosuggestions
14zinit light zsh-users/zsh-syntax-highlighting
15zinit light agkozak/zsh-z