Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dmancloud/e5e3452f914609472db048b4008cf913 to your computer and use it in GitHub Desktop.
Save dmancloud/e5e3452f914609472db048b4008cf913 to your computer and use it in GitHub Desktop.
Customize Your Terminal On MacOS Like A Pro

Customize Your Terminal On MacOS Like A Pro

Customize your terminal using iTerm2, oh-my-zsh and powerlevel10k works on both Macbook Intel and Macbook M1.

Install Brew

The Missing Package Manager for macOS

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install iTerm2

iTerm2 has better color fidelity than the built in Terminal, so your themes will look better.

brew install iterm2

iTerm2 Color Settings

The theme I perfer is Argonaut, below you will find a link to other themes you can select from

Download & Save the file and then open. The color settings will be imported into iTerm2. Apply them in iTerm through iTerm → preferences → profiles → colors → load presets. You can create a different profile other than Default if you wish to do so.

Install Oh My Zsh

More info here: https://github.com/robbyrussell/oh-my-zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Install Powerlevel10k

Powerlevel10k is a theme for Zsh. It emphasizes speed, flexibility and out-of-the-box experience

git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Set ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc.

Further Customizations

Auto Suggestions Plugin

  1. Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)

    git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  2. Add the plugin to the list of plugins for Oh My Zsh to load (inside ~/.zshrc):

    plugins=( 
        # other plugins...
        zsh-autosuggestions
    )

Syntax Highlighting Plugin

  1. Clone the repository:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  1. Activate the plugin in ~/.zshrc:

    plugins=( [plugins...] zsh-syntax-highlighting)

Visual Studio Code Configuration

Installing a patched font will mess up the integrated terminal in VS Code unless you use the proper settings. You'll need to go to settings (CMD + ,) and add or edit the following values:

  • for Source Code Pro + Font Awesome: "terminal.integrated.fontFamily": "'SourceCodePro+Powerline+Awesome Regular'". The single quotes are important! Restart VS Code after the config change.

  • for Source Code Pro: "terminal.integrated.fontFamily": "Source Code Pro for Powerline"

  • for Meslo: "terminal.integrated.fontFamily": "Meslo LG M for Powerline"

  • for other fonts you'll need to check the font name in Font Book. You can right click on them on select "Show in Finder" to get the exact name.

You can also set the fontsize e.g.: "terminal.integrated.fontSize": 14

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