Skip to content

Instantly share code, notes, and snippets.

@Rankarusu
Last active September 26, 2023 15:05
Show Gist options
  • Save Rankarusu/7b6310c731b782aa9246400292211157 to your computer and use it in GitHub Desktop.
Save Rankarusu/7b6310c731b782aa9246400292211157 to your computer and use it in GitHub Desktop.
zsh setup mac

zsh setup mac

Install zsh

use homebrew

brew install zsh

Oh My Zsh

Oh My Zsh is a framework for customizing your zsh

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

the script should set zsh as your default shell. If it does not, you can do that manually by running:

chsh -s $(which zsh)

Lastly, apply changes by starting a new shell instance or by by running:

source ~/.zshrc

Customization

All your shell customization takes place in you .zshrc.

Oh My Zsh Plugins

You can add shell plugins by putting them into a plugins array (without commas!) inside your .zshrc:

plugins=(a b c)

You'll find a list of all plugins on the Oh My Zsh Wiki. Additional plugins can be installed by putting them into the respective plugin directory.

zsh-syntax-highlighting

syntax highlighting in you shell so you see early when you mistyped.

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

zsh-autosuggestions

autocompletion of any previous commands. Use → to complete!

git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

Make sure to also add the installed plugins to your plugins array!

e.g.

plugins=(git zsh-autosuggestions zsh-syntax-highlighting)


Themes

you can change your theme by editing the ZSH_THEME variable inside your .zshrc. A List of available themes can be found here

Powerlevel10k

If you want to make your shell even ✨prettier✨, you can configure and install powerlevel10k

  1. Install the patched font for icons and stuff
  2. Install powerlevel10k via Oh My Zsh
  3. Dont forget to set your ZSH_THEME to "powerlevel10k/powerlevel10k"

On your next terminal run, a configuration wizard will take over. You can always start him again manually by running p10k configure

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