Steps for getting a customizable terminal config.
-
Install Homebrew package manager for MacOS.
-
Install iTerm2 terminal emulator.
-
Install Starship cross-shell prompt.
-
Install Oh My Zsh, a community-driven framework for managing your zsh configuration.
-
Install zsh-syntax-highlighting to enable syntax highlighting in the terminal.
-
Edit the
.zshrc
config file to enable the installed prompts and plugins.-
Open the terminal.
-
Open the
.zshrc
config file in a text editor:-
vim ~/.zshrc
-
-
Now find the line starting with
ZSH_THEME=
and comment the line out by adding a#
at the start of the line.-
# example config # ZSH_THEME="robbyrussell"
-
-
Then enable the
zsh-syntax-highlighting
plugin. Find theplugin
directive in the config file and addzsh-syntax-highlighting
to the end of the list of plugins:-
# Note, the 'zsh-syntax-highlight' plugin # "NEEDS" to go at the end of the the list plugins=(git brew npm zsh-syntax-highlighting)
- See this FAQ for why the zsh-syntax-highlight plugin needs to go last.
-
-
Finally enable the
Starship
prompt:-
Scroll to the end of the config and paste the following:
-
eval "$(starship init zsh)"
-
Save config file.
-
-
-
Install
Powerline
symbols/fonts for theStarship
prompt.-
Download the
PowerlineSymbols.otf
font pack from Github: https://github.com/powerline/powerline/tree/develop/font -
Double click / open the downloaded font pack. This will open a
Font Book
window.- Click on the
Install font
button to install the font onto your system.
- Click on the
-
Update the iTerm preferences to use the
Powerline
fonts.-
Switch to an iTerm window and click on the
iTerm2
menu item in the top left corner of the screen. Then selectPreferences
. Or use the shortcut keyscommand
+,
-
In the
Preferences
window, switch to theProfiles
tab (in the top of the Preferences window). -
Select a profile (if not using the
Default
profile). -
Select the
Text
tab on the right section. -
Find and check the option
Use a different font form non-ASCII text
. This should now display theNon-ASCII Font
section under the checkbox. -
In the
Non-ASCII Font
section, click the font selection box and selectPowerlineSymbols
.
-
-
-
Restart the terminal or import the new settings:
-
source ~/.zshrc
-
Now you should have a terminal that looks something like this:
iTerm is not available for Windows, Hyper is a good alternative. You will need to search Google for setting up zsh
and oh-my-zsh
in WSL.
Then, you'll need to install the Powerline fonts manually.
-
Clone the repo from here: https://github.com/powerline/fonts.
-
cd
into the repo root and install the fonts with Powershell:-
.\install.ps1
-
-
Select a Powerline compatible font in your terminal emulator (Hyper, for example).