zsh

Customizing MacOS .zsh Terminal

Posted by Ray on August 19, 2021

This document is a guide for customizing MacOS .zsh terminal.

  1. Download iterm2 from their official site: https://iterm2.com/.

  2. Install ohmyzsh from their official documentation: https://ohmyz.sh/#install.
    1
    
    $ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
    
  3. Install power level 10k from the official repository: https://github.com/romkatv/powerlevel10k#installation.
    1
    
    $ git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
    
  4. Open the .zshrc file using your text editor of choice, and edit ZSH_THEME into powerlevel10k/powerlevel10k. Save the changes.

  5. Restart the terminal by quitting and and reopening.

  6. Configure the themes to your liking.

This is the configuration of my terminal:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
> install font: yes
> prompt style: rainbow
> character set: unicode
> show current time: No
> prompt separator: angled
> prompt heads: sharp
> prompt tails: flat
> prompt height: two lines
> prompt connection: disconnected
> prompt frame: no frame
> prompt spacing: compact
> icons: few icons
> prompt flow: concise
> enable transient prompt: no
> instant prompt mode: verbose
> apply changes to ~/.zshrc: yes

To change color scheme, downloaded color scheme reference from: https://github.com/QuentinWatt/dark-flat-iterm-colors.

Then, open .p10.zsh and search for POWERLEVEL9K_SHORTEN_STRATEGY. Edit truncate_to_unique into truncate_to_last.

Finally, Edit the profile window preference to 110x20

Reference: https://stackoverflow.com/questions/61176257/customizing-powerleve10k-prompt.