Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save isawrub/8fcd3ba3140669ffc12cf4caaa67d76a to your computer and use it in GitHub Desktop.
Save isawrub/8fcd3ba3140669ffc12cf4caaa67d76a to your computer and use it in GitHub Desktop.

Oh My Zsh with autosuggestions & syntax-highlighting + PowerLevel10k.

Zsh?

Oh My Zsh is a framework for Zsh, the Z shell.

  • In order for Oh My Zsh to work, Zsh must be installed.
    • Please run zsh --version to confirm.
    • Expected result: zsh 5.0.8 or more recent
  • Additionally, Zsh should be set as your default shell.
    • Please run echo $SHELL from a new terminal to confirm.
    • Expected result: /usr/bin/zsh or similar

Install and set up zsh as default

If necessary, follow these steps to install Zsh:

  1. There are two main ways to install Zsh:

    • With the package manager of your choice, e.g. sudo apt install zsh (see below for more examples)
    • From source, following the instructions from the Zsh FAQ.
  2. Verify installation by running zsh --version. Expected result: zsh 5.0.8 or more recent.

  3. Make it your default shell: chsh -s $(which zsh)

    • Note that this will not work if Zsh is not in your authorized shells list (/etc/shells) or if you don't have permission to use chsh. If that's the case you'll need to use a different procedure.
  4. Log out and log back in again to use your new default shell.

  5. Test that it worked with echo $SHELL. Expected result: /bin/zsh or similar.

  6. Test with $SHELL --version. Expected result: zsh 5.8 or similar

Install with omz with curl

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

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by

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

  • Download zsh-syntax-highlighting by

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

  • nano ~/.zshrc find plugins=(git)

  • Append zsh-autosuggestions & zsh-syntax-highlighting to plugins() like this

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

  • Reopen terminal

  • Install Powerlevel10k

git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k

  • Enable it, change the value of ZSH_THEME ~/.zshrc ZSH_THEME="powerlevel10k/powerlevel10k"
  • Reopen terminal

Ref

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