I want to share with you, how to customize the MAC terminal, iTerm2 and Visual Studio Code terminal with ZSH and powerlevel10k.
I suggest you install brew if you did not install it before. Let’s get started!
Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
After this installation, let go of the root folder level by typing “cd” and then click enter. Then, type the below command to open the Zsh’s config file in Visual Studio Code (VS Code).
code ~/.zshrc
After this command, VS Code will be opened. When it is opened, change the ZSH_THEME to agnoster
and save the file.
ZSH_THEME="agnoster"
Close the iTerm2 terminal completely and then reopen it.
If you want, you can change the color theme with flat colors, you can go to Quentin Watt’s GitHub repo and download the “flat-clolors.itermcolors” file.
Then go back to iTerm, and go to Preferences -> Profiles -> Colors -> Color Presets Drop Down -> Import and then select the downloaded “flat-colors.itermcolors” file.
Powerlevel10k Installation
For this, we should run the below command on the iTerm terminal. Before make sure that the .zshrc
file is readable and writeable.
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
Then, again open the ~/.zshrc
file with VS Code or any editor and change the ZHS_THEME value to “powerlevel10k/powerlevel10k“
.
ZSH_THEME="powerlevel10k/powerlevel10k"
Then save the file, quit iTerm2, and re-open it. You will see the Powerlevel10k configuration wizard.
For the below question, enter the “y” and continue.
For the below question, enter the “y” and continue.
For the below question, enter the “y” and continue.
For the below question, enter the “y” and continue.
For the below question, enter the “3” and continue.
For the below question, enter the “1” and continue.
For the below question, enter the “1” and continue.
For the below question, enter the “1” and continue.
For the below question, enter the “1” and continue.
For the below question, enter the “1” and continue.
For the below question, enter the “1” and continue.
For the below question, enter the “1” and continue.
For the below question, enter the “2” and continue. If you want, you can go with “1”. It depends on your taste. :)
For the below question, enter the “1” and continue.
For the below question, enter the “y” and continue. If you want, you can go with “no“. It depends on your taste.
For the below question enter the “1” and continue.
For the below question, enter the “y” and continue.
After all of these settings, close the iTerm and re-open it, and you will see something.
Syntax Highlighting
The first I like to do after setting up the ZSH configuration is to install a plugin called zsh-syntax-highlighting. It provides syntax highlighting for the ZSH shell.
# depending on the /plugins folder in your local setup
cd $HOME/.oh-my-zsh/plugins
# then clone the git repository
git clone https://github.com/zsh-users/zsh-syntax-highlighting.gitecho "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
Visual Code Terminal Settings
Open the Visual Code and then go to the Code -> Preferences -> Settings. Then, on the settings page, type “settings.json” and then click the JSON and then click the “Edit in settings.json”.
After this step, add the below line to your settings.json file and save it.
"terminal.integrated.fontFamily": "MesloLGS NF",
Then close and re-open the VS Code. You will see the terminal like the below screen. Even it should work without closing and opening the VS Code.
Mac’s Default Terminal Settings
Go to Preferences -> Profiles -> Change and then change the font to “MesloLGS NL”