- Oh-My-Zsh is a framework for Zsh, the Z shell. Oh-my-Zsh configuration turned out to be not so straight-forward with instructions being scattered all over, so I decided to gather it all in one place. Follow the steps to set up and configure oh-my-zsh in your terminal and customize it by adding additional plugins like docker commands completion.
- Oh My Zsh is a community-driven framework for managing your zsh configuration and comes bundled with thousands. This post explains how to have posh-git prompt style in Oh My Zsh theme on Mac. After 4 years of using Windows, I am coming back to using a Mac.
Sometimes, using the default terminal sucks. You want to go out of the ordinary, to add life to the boring terminal and improve your productivity.
The default command line tool that comes with mac is bash and as a software developer you would most likely be working with it a lot: writing shell scripts, installing packages, working with git, etc. So why don't we make it look better and even more powerful, enter zsh.
In this walk-through, we will configure iTerm2 with ZSH and its dependencies. This is a no-brainer, and after this, you'll ponder the reason for not discovering ZSH earlier. Well, since you're here already, let's kick-start this.
Z shell (Zsh) is a Unix shell built on top of bash (the default shell for macOS) with a large number of improvements.
Keynotes
- Homebrew installation
- iTerm2 installation
- ZSH and Oh My ZSH installations
- Setting up the dependencies to create a beautiful terminal
Step 1: Install Homebrew
Homebrew is a free and open-source software package management system that simplifies the installation of software on Apple's macOS.
Before installing Homebrew, we need to install the CLI tools for Xcode. Open your terminal and run the command:
If you get an error, run xcode-select -r
to reset xcode-select.
Then, install Homebrew.
Step 2: Install iTerm2
iTerm2 is a replacement for terminal and the successor to iTerm. Most software engineers prefer iTerm2 over the default terminal that ships with macOS as a result of its cool features. You can integrate zsh into iTerm2 to increase productivity.
To install iTerm2, run the command:
Step 3: Install ZSH
Zsh is a shell designed for interactive use, although it is also a powerful scripting language.
By default, macOS ships with zsh located in /bin/zsh
. Let's install zsh using brew and make iTerm2 use it.
Step 4: Install Oh My Zsh
![Zsh Zsh](https://miro.medium.com/max/1088/1*VWdXxjU4DXJNdqpxYVVVvw.png)
'Oh My Zsh is an open source, community-driven framework for managing your zsh configuration. It will not make you a 10x developer…but you might feel like one'— Robby Russell
It runs on Zsh to provide cool features configurable within the ~/.zhrc
config file. Install Oh My Zsh by running the command
Check the installed version
You can upgrade it to get the latest features it offers.
Restart iTerm2 to dive into the new experience of using Zsh. Welcome to the 'Oh My Zsh' world 😄.
That's not all. Now, we will install the dependencies to get the best out of Zsh.
Step 5: Change the Default Theme
Oh My Zsh comes bundled with a lot of themes. The default theme is robbyrussell, but you can change it to any theme of your choice. In this scenario, I changed it to agnoster, an already pre-installed theme.
You need to set this theme in your ~/.zshrc
config file. To open the config file (.zshrc), run the command: nano ~/.zshrc
Or open the file in a text editor with open ~/.zshrc
Set the zsh theme
and update your changes source ~/.zshrc
Using a Custom Theme
To install another theme not pre-installed, clone the repository into custom/themesdirectory. In this scenario, we'll install powerlevel9k,
Then, select this theme in your .zshrc file
Update your changes by running the command source ~/.zshrc
Navigate to iTerm2 > Preferences > Profiles > Colors
if you wish to change the background color of the terminal.
The selected theme in this scenario requires powerline fonts. So, let's install that.
Step 6: Install Fonts
I will be using Inconsolata. Get your preferred font out of these powerline fonts. Then, download and install it.
Or download the entire font.
To change the font, navigate to iTerm2 > Preferences > Profiles > Text > Change Font
.
Now, you can see Inconsolata listed as one of the fonts. Select your preferred font. For fonts that support ligatures like Fira Code, check the 'Use ligatures' option to view your arrows and other operators in a stylish manner like ( → ).
Step 7: Install Color Scheme
Let's change the color scheme to bring out the beauty of our terminal. Navigate to iTerm2-Color-Schemes and download the ZIP folder. Then, extract the downloaded folder cos what we need resides in the schemes folder.
- Navigate to the schemes folder and select your preferred color schemes to import them.
- Double-click on a specific color scheme to activate it. In this scenario, I activated Batman. You can choose to activate one of the preloaded color schemes such as Solarized Dark. It is also a good color scheme.
Navigate to iTerm2 > Preferences > Profile > Colors > Color Presets > Import
Tada! 🎉 We're done with the basic settings.
Step 8: Install Plugins
Oh My ZSH comes preloaded with a git plugin. To add more, for instance, docker, auto-suggestion, syntax highlighting and more:
- Clone the Git repository. Let's add docker plugin.
- Run the command
open ~/.oh-my-zsh
and navigate to.oh-my-zsh > custom > plugins
directory to view the cloned directory. - Then, add the plugin to the plugin section of the
~/.zshrc
config file
- Update your changes by running the command
source ~/.zshrc
Step 9: Add Aliases
Aliases are shortcuts used to reduce the time spent on typing commands. To add aliases to commands you use frequently, navigate to the aliases section within the .zshrc file and add the aliases
For a complete guide on configuring and using aliases, read my article on Aliases. You can go a step further to create a custom message on your terminal
If you know about other means of improving productivity using ZSH, you can reach out to me on Twitter. I will be glad to hear from you.
If you are using Mac as development machine, Terminal.app
must be one of the most used apps. Terminal might be not fancy to begin with, but you can totally make it more elegant and fancy if you follow with me.
We will be doing these for our Terminal
- Install Terminal Profile: Customize Terminal Color
- Install
oh-my-zsh
: Use powerfulzsh
for Terminal, instead ofshell
- Install
oh-my-zsh
themes: Beautifyoh-my-zsh
- Instal
oh-my-zsh
must-have plugins: Get more advanced and convenient features for Terminal
Preparation
Recommend to install homebrew
first:
Install zsh if you are on macOS version prior to Catalina:
Install Terminal Profile
- Go to osx-terminal-theme and download your favorite theme in
scheme
folder - Double click the theme file to install and set as default
Feel free to use my Terminal Profile if you would like to try: https://gist.github.com/tonyxu-io/6b845cb1a53622eb4f1ce4063365e427
![For For](https://pythonautomationtutorial.com/static/img/python-oh-my-zsh-eg.png)
'Oh My Zsh is an open source, community-driven framework for managing your zsh configuration. It will not make you a 10x developer…but you might feel like one'— Robby Russell
It runs on Zsh to provide cool features configurable within the ~/.zhrc
config file. Install Oh My Zsh by running the command
Check the installed version
You can upgrade it to get the latest features it offers.
Restart iTerm2 to dive into the new experience of using Zsh. Welcome to the 'Oh My Zsh' world 😄.
That's not all. Now, we will install the dependencies to get the best out of Zsh.
Step 5: Change the Default Theme
Oh My Zsh comes bundled with a lot of themes. The default theme is robbyrussell, but you can change it to any theme of your choice. In this scenario, I changed it to agnoster, an already pre-installed theme.
You need to set this theme in your ~/.zshrc
config file. To open the config file (.zshrc), run the command: nano ~/.zshrc
Or open the file in a text editor with open ~/.zshrc
Set the zsh theme
and update your changes source ~/.zshrc
Using a Custom Theme
To install another theme not pre-installed, clone the repository into custom/themesdirectory. In this scenario, we'll install powerlevel9k,
Then, select this theme in your .zshrc file
Update your changes by running the command source ~/.zshrc
Navigate to iTerm2 > Preferences > Profiles > Colors
if you wish to change the background color of the terminal.
The selected theme in this scenario requires powerline fonts. So, let's install that.
Step 6: Install Fonts
I will be using Inconsolata. Get your preferred font out of these powerline fonts. Then, download and install it.
Or download the entire font.
To change the font, navigate to iTerm2 > Preferences > Profiles > Text > Change Font
.
Now, you can see Inconsolata listed as one of the fonts. Select your preferred font. For fonts that support ligatures like Fira Code, check the 'Use ligatures' option to view your arrows and other operators in a stylish manner like ( → ).
Step 7: Install Color Scheme
Let's change the color scheme to bring out the beauty of our terminal. Navigate to iTerm2-Color-Schemes and download the ZIP folder. Then, extract the downloaded folder cos what we need resides in the schemes folder.
- Navigate to the schemes folder and select your preferred color schemes to import them.
- Double-click on a specific color scheme to activate it. In this scenario, I activated Batman. You can choose to activate one of the preloaded color schemes such as Solarized Dark. It is also a good color scheme.
Navigate to iTerm2 > Preferences > Profile > Colors > Color Presets > Import
Tada! 🎉 We're done with the basic settings.
Step 8: Install Plugins
Oh My ZSH comes preloaded with a git plugin. To add more, for instance, docker, auto-suggestion, syntax highlighting and more:
- Clone the Git repository. Let's add docker plugin.
- Run the command
open ~/.oh-my-zsh
and navigate to.oh-my-zsh > custom > plugins
directory to view the cloned directory. - Then, add the plugin to the plugin section of the
~/.zshrc
config file
- Update your changes by running the command
source ~/.zshrc
Step 9: Add Aliases
Aliases are shortcuts used to reduce the time spent on typing commands. To add aliases to commands you use frequently, navigate to the aliases section within the .zshrc file and add the aliases
For a complete guide on configuring and using aliases, read my article on Aliases. You can go a step further to create a custom message on your terminal
If you know about other means of improving productivity using ZSH, you can reach out to me on Twitter. I will be glad to hear from you.
If you are using Mac as development machine, Terminal.app
must be one of the most used apps. Terminal might be not fancy to begin with, but you can totally make it more elegant and fancy if you follow with me.
We will be doing these for our Terminal
- Install Terminal Profile: Customize Terminal Color
- Install
oh-my-zsh
: Use powerfulzsh
for Terminal, instead ofshell
- Install
oh-my-zsh
themes: Beautifyoh-my-zsh
- Instal
oh-my-zsh
must-have plugins: Get more advanced and convenient features for Terminal
Preparation
Recommend to install homebrew
first:
Install zsh if you are on macOS version prior to Catalina:
Install Terminal Profile
- Go to osx-terminal-theme and download your favorite theme in
scheme
folder - Double click the theme file to install and set as default
Feel free to use my Terminal Profile if you would like to try: https://gist.github.com/tonyxu-io/6b845cb1a53622eb4f1ce4063365e427
Install oh-my-zsh
Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes, and a few things that make you shout…
Install oh-my-zsh
:
Install oh-my-zsh theme
Built-in themes
oh-my-zsh
provides some built-in themes which you can immediately use:
- Find your favorite theme in built-in themes list: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
- Set
ZSH_THEME
to your favorite theme name in~/.zshrc
- Activate setting by
source ~/.zshrc
Third-party themes
Tally odbc driver not found. fasters. There are more third-party themes developped for oh-my-zsh
, find and install them here:
Install oh-my-zsh must-have plugins
oh-my-zsh
Summoners war account for sale. has many powerful plugins, below are some must-have plugins that will boost your productivity.
Sample config:
git
Built-in,use abbreviations for git commands, e.g. gaa
->git add --all
, use alias | grep git
to get all abbreviations commands
Activate: Add git
to ~/.zshrc
plugins list.
extract
Built-in, no need to use complicated tar
to extract zip files
Oh My Zsh For Macbook
Activate: Add to extract
to ~/.zshrc
plugins list.
Usage: extract file_name
autojump
Use j
to quickly jump to a folder, e.g. j Downloads
->cd ~/Downloads
Install: brew install autojump
Activate: Add autojump
to ~/.zshtc
plugins list.
zsh-syntax-highlighting
Commands syntax highlight plugin
Install: brew install zsh-syntax-highlighting
Activate: Add zsh-syntax-highlighting
to ~/.zshtc
plugins list.
zsh-autosuggestions
Auto complete commands by typing →
Oh My Zsh For Macbook Pro
Install: git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Activate: Add zsh-autosuggestions
to ~.zshrc
plugins list.