Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jvmonjo/d1b8ee6a7684cfd19615c934b46227fb to your computer and use it in GitHub Desktop.
Save jvmonjo/d1b8ee6a7684cfd19615c934b46227fb to your computer and use it in GitHub Desktop.
install oh my zsh on macos | change terminal theme on macos | Change console theme on macos

How to customize mac os terminal using oh my zsh

Step1: download & install oh-my-zsh via curl

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

Note: if you already have folder then delete it running rm -r /Users/rupeshti/.oh-my-zsh

Step2 Open Zshrc file

open ~/.zshrc

Step3: Update theme

Add below line in the file:

ZSH_THEME="agnoster"

You can choose some other theme from this catalog of themes : https://github.com/ohmyzsh/ohmyzsh/wiki/Themes I am selecting agnoster

My other fav themes are

strug

image

takashiyoshida

image

Soliah

image

josh

image

Add autocomplete fix

step1: Run below script first on your terminal to install zsh plugins

git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-completions.git ~/.oh-my-zsh/custom/plugins/zsh-completions
git clone https://github.com/zsh-users/zsh-history-substring-search.git ~/.oh-my-zsh/custom/plugins/zsh-history-substring-search

step2: open .zshrc and below 2 lines

# Terminal autocomplete fix
autoload -Uz compinit && compinit

plugins=(
    git
    docker
    asdf
    zsh-autosuggestions
    zsh-completions 
    zsh-history-substring-search 
    zsh-syntax-highlighting
)

image

image

visit zsh-users github to see other available plugins.

Step4: Install font required for theme

You need some fonts for these themes lets download and install fonts first. If you have brew installed then try runing this script to install powerline fonts brew install fonts-powerline

OR install fonts manually with below steps

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

Step5: Change Terminal font

Go to Terminal>Preferences>Profiles>Font select change and select desired font I am selecting Meslo LG L DZ for Powerline Select Regular.

Step 6: Open Terminal

In your terminal type zsh to switch to zsh console.

Step 7: Change the default shell to ZSH

If you liked zsh then you can permanently switch to ZSH by doing below:

  1. In the Terminal app on your Mac, choose Terminal > Preferences, then click General.

  2. Under “Shells open with,” select “Command (complete path),” then enter the path to the shell you want to use.

  3. For zsh enter bin/zsh

  4. Then open your terminal in MacOS you will see zsh as your default shell enjoy!

Step 8: VSCode settings

If you are using VSCode and want to use default zsh do below

  1. Open user settings in json format in vscode
  2. Add below lines in your settings.json file
   "terminal.integrated.fontFamily": "Meslo LG M DZ for Powerline,monospace",
    "terminal.integrated.defaultProfile.osx": "zsh",
    "terminal.external.osxExec": "iTerm.app",
    "terminal.external.linuxExec": "iterm",

Enjoy the theme! 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment