Skip to content

Instantly share code, notes, and snippets.

@MihailPreis
Created November 4, 2022 07:30
Show Gist options
  • Save MihailPreis/b5c7db640e06811f151d8a36a7d94790 to your computer and use it in GitHub Desktop.
Save MihailPreis/b5c7db640e06811f151d8a36a7d94790 to your computer and use it in GitHub Desktop.
Convenient terminal setup for mac

iTerm + OMZ + Plugins

  1. Install Brew:

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

    brew install --cask iterm2

    And then change iTerm2 preferences:

    • iTerm2 Preferences -> Profiles -> Keys -> Key Mappings -> Open Presets... and select Natural Text Editing.
    • iTerm2 Preferences -> Profiles -> Window -> Set Columns to 150 (or so).
    • iTerm2 Preferences -> Profiles -> Colors -> Open Color Presets... and choose the one you like.
  3. Install Oh My Zsh:

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

    • zsh-syntax-highlighting

      brew install zsh-syntax-highlighting
      echo 'source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh' >> ~/.zshrc
    • zsh-autosuggestions

      brew install zsh-autosuggestions
      echo 'source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh' >> ~/.zshrc
    • zsh-history-substring-search

      brew install zsh-history-substring-search
      echo 'source /opt/homebrew/share/zsh-history-substring-search/zsh-history-substring-search.zsh' >> ~/.zshrc
    • zsh-completions

      brew install zsh-completions
      
      cat >> ~/.zshrc << EOF
      
      if type brew &>/dev/null; then
        FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
      
        autoload -Uz compinit
        compinit
      fi
      EOF
  5. Install Powerlevel10k:

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

    And then set ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc.

  6. Finish configuring Powerlevel10k and use.

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