DEV Community

Moya Richards
Moya Richards

Posted on

Zsh - install git plugin and theme

display GIT information in terminal

Want your terminal to display information about GIT? If the answer is YES, let's get to it.

Check if Zsh is installed

Every new Mac uses the Z shell (Zsh) by default, but if it is not available to your system install it using Homebrew.



echo $SHELL


Enter fullscreen mode Exit fullscreen mode

Expected result of the echo $SHELL command : /bin/zsh

Install zsh using Homebrew(if it is not installed):



brew install zsh

# Set zsh as your default shell
chsh -s $(which zsh)


Enter fullscreen mode Exit fullscreen mode

Install Oh My Zsh

Open terminal, run the command



sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"


Enter fullscreen mode Exit fullscreen mode

Modify your Oh My Zsh settings

The configuration file for zsh is called .zshrc and lives in your home folder (~/.zshrc).

locate that file and open it



open ~/.zshrc


Enter fullscreen mode Exit fullscreen mode

Modify your Plugins

Add plugins to your shell by adding the name of the plugin to the plugin array in the ~/.zshrc file. Separate the names of plugins with a space



plugins=(git)


Enter fullscreen mode Exit fullscreen mode

Change your Theme

Changing theme is as simple as changing a string in your configuration file. The default theme is robbyrussell. Just change that value to the change theme, and don't forget to .



ZSH_THEME=pygmalion


Enter fullscreen mode Exit fullscreen mode

Apply your changes

To apply the changes you have made to the theme or plugins you need to either

  1. start a new shell instance

  2. reload the configuration for the current shell



#reload configuration
source ~/.zshrc


Enter fullscreen mode Exit fullscreen mode

Install fonts:

You must select a font in the Terminal Preferences, under Profiles, for your zsh theme to display properly

Most Zsh themes use the powerline fonts, so let's install them.

** Install powerline fonts **



# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd ..
rm -rf fonts


Enter fullscreen mode Exit fullscreen mode

Change Font in the Mac OS X Terminal

Image of Terminal without font
Image of Terminal without font
  • Open Terminal, then navigate to Terminal Preferences > Profiles > Font , then click the Change button.

  • Select Ubuntu Mono derivative Powerline and set the font size to your liking.

  • Close preferences, and quit Terminal.

Image of Terminal with font
Expected Result: Image of Terminal with font

Change Font for Terminal in Visual Studio Code?

Image of Terminal in Visual Studio Code without font
Image of Terminal in Visual Studio Code without font

Open settings.json in VSCode

Press command + shift + p in your VSCode window. Then, search for settings.json and open it.
Command Palette-settings.json

Add this line to the settings.json :



{
  "terminal.integrated.defaultProfile.osx": "zsh",
  "terminal.integrated.fontFamily": "Ubuntu Mono derivative Powerline",
  "terminal.integrated.fontSize": 12
}


Enter fullscreen mode Exit fullscreen mode

settings.json code

Image of Terminal in Visual Studio Code with font
Image of Terminal in Visual Studio Code with font

Top comments (4)

Collapse
 
amann_mahapatra profile image
Amann Mahapatra

this is cool

Collapse
 
smsivaprakaash profile image
Siva Prakaash S M

To setup in mac teminal.
to get the simlar color like cobalt2 you can follow this step. github.com/jabranr/cobalt2-like/tr...
and follow the above stem

Collapse
 
sigmawolf93 profile image
CUTE PSYCHO

Thank you.

Collapse
 
massiresogore profile image
massiresogore

Thanks a lot🥹