I use iTerm2 as my default Terminal on the Mac.It significantly enhances my development workflow, especially with its convenient shortcuts for managing multiple panes during server operations.
To download iTerm2 on your Mac click here.
For my shell, I opt for ZSH, short for Z Shell. ZSH is an extended version of the familiar Bourne shell (sh), offering additional functionalities through support for plugins and themes.
If you’re on a Mac, the easiest way to install ZSH is through Homebrew. A single command will do the trick:
brew install zsh
Make ZSH your default shell with:
chsh -s /usr/local/bin/zsh
For older Mac OS High Sierra and earlier versions, use:
chsh -s /bin/zsh
To streamline the configuration of plugins and styling for ZSH, I turn to Oh-My-Zsh. It’s a framework designed to manage ZSH configurations efficiently.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
I use the .zshrc file to configure plugins and themes, as opposed to the .bash_profile file used for the Bash shell.
Git:
For Git functionality, search for plugins section and update as below in .zshrc file:
plugins=(git)
To apply zsh configuration changes, please run the below command
source ~/.zshrc
Docker:
Enable Docker auto-completion with:
plugins=(git docker)
To apply zsh configuration changes, please run the below command
source ~/.zshrc
Zsh Autosuggestions:
Implement fast and unobtrusive auto-suggestions with the ‘zsh-autosuggestions’ plugin:
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
Enable Zsh Autosuggestions with:
plugins=(git docker zsh-autosuggestions)
To apply zsh configuration changes, please run the below command
source ~/.zshrc
Zsh Syntax Highlighting:
Bring syntax coloring similar to Fish with the ‘zsh-syntax-highlighting’ plugin:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
Enable Zsh Autosuggestions with:
plugins=(git docker zsh-autosuggestions zsh-syntax-highlighting)
To apply zsh configuration changes, please run the below command
source ~/.zshrc
Congratulations! With these essential plugins configured, it’s time to add style to your ZSH shell.
Upgrade your ZSH appearance with Powerlevel10k, an improved version of Powerlevel9k.
Font Installation:
Start by installing the required fonts:
Open the downloaded fonts and press “Install Font.” Set the chosen font in iTerm2 (iTerm → Settings → Profiles → Text → Font).
Restart iTerm2 for all changes to take effect.
Enjoy an enhanced terminal experience with iTerm2, ZSH, and the power-packed set of plugins and themes!
By default, word jumps (option + → or ←) and word deletions (option + backspace) do not work. To enable these, go to (iTerm → Settings → Profiles → Keys → Presets… → Natural Text Editing)
Configuring a customized font can disrupt the integrated terminal in Visual Studio Code unless you adjust the appropriate settings. To resolve this, navigate to the VS Code preferences and modify the following key-value pairs:
For Source Code Pro with Font Awesome:
"terminal.integrated.fontFamily": "'SourceCodePro+Powerline+Awesome Regular'"
Make sure to include the single quotes. Restart VS Code after making the configuration change.
For Source Code Pro:
"terminal.integrated.fontFamily": "Source Code Pro for Powerline"
For Meslo:
"terminal.integrated.fontFamily": "Meslo LG M for Powerline"
Once you have the required fonts installed, proceed to install Powerlevel10k using git and Oh-My-Zsh:
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Next, set the ZSH_THEME in your ~/.zshrc file to “powerlevel10k/powerlevel10k” and reload your terminal for the changes to take effect:
echo 'ZSH_THEME="powerlevel10k/powerlevel10k"' >> ~/.zshrcsource ~/.zshrc