Skip to content

Latest commit

 

History

History
111 lines (69 loc) · 3.04 KB

zsh.md

File metadata and controls

111 lines (69 loc) · 3.04 KB

zsh

Z shell comes pre-bundled with macOS Catalina (10.15) and above. This guide will help you configure zsh with code-completion, useful aliases and theming.

Manual installation

Note: ignore if you are using macOS 10.15+

If you are using an earlier macOS version, you will need to install zsh manually.

  1. Make sure you have installed Homebrew on your system - if not, read the Homebrew guide;

    which brew
  2. Open terminal and run the following command:

    brew install zsh
  3. Restart your terminal.

Oh-my-zsh

Oh my zsh is a plugin system for zsh that allows you to easily expand your terminal with additional features.

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

Powerlevel10k theme

Powerlevel10k is an excellent theme for zsh.

Installation
  1. Download and install the Meslo Nerd Font on your local machine.

    Double-click on each file and click "Install".

  2. Configure your terminal to use the Meslo Nerd Font.

    Apple Terminal

    Open Terminal → Preferences → Profiles and select MesloLGS NF from the Text dropdown.

    iTerm2

    Open iTerm2 → Preferences → Profiles → Text, click Change under Font and select MesloLGS NF family.

    I suggest to also change the font-size to 13px.

  3. Download Powerlevel10k

    git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
  4. Enable Powerlevel10k in ~/.zshrc

    Edit ~/.zshrc with your editor and set the following variable.

    ZSH_THEME="powerlevel10k/powerlevel10k"
  5. Configure Powerlevel10k theme (if it doesn't automatically trigger the configuration wizard)

    p10k configure

Plugins

Plugins are mostly meant for code completion. If you are a JavaScript developer like me, you could start with the following.

git
npm
yarn
extract

Aliases

Aliases adhere to each developer's personal preference. My only suggestion would be to use the following.

alias ll="ls -la"
  1. Open ~/.zshrc with your favourite editor.
  2. Append the lines above either at the end of the file or at the relevant section.

Unshare history between tabs

If you prefer NOT to share history between tabs in your terminal, add the following lines to your ~/.zshrc after source $ZSH/oh-my-zsh.sh.

unsetopt inc_append_history
unsetopt share_history