Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save buu-nguyen/b635a5c9824207101502634575d17b6a to your computer and use it in GitHub Desktop.
Save buu-nguyen/b635a5c9824207101502634575d17b6a to your computer and use it in GitHub Desktop.
MacOS Setup.md

Homebrew

Prerequisistes

Post-install

  • echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> $HOME/.zprofile

Switch to homebrew's Zsh

  1. brew install zsh

  2. Add /opt/homebrew/bin/zsh to /etc/shells file

  • sudo echo "/opt/homebrew/bin/zsh" >> /etc/shells
  1. Change to default login shell
  • chsh -s /opt/homebrew/bin/zsh $USER
  1. Make sure new version of Zsh is in active echo $SHELL (should see "/usr/local/bin/zsh") echo $ZSH_VERSION (should see "5.0.2" instead of "4.3.11" bullt-in in OS X 10.8)

  2. Create "/usr/local/share/zsh/site-functions" directory to match with what's in "echo $FPATH" output

  3. Support homebrew completion with the command ln -s /usr/local/Library/Contributions/brew_zsh_completion.zsh /usr/local/share/zsh/site-functions/_brew

Oh my zsh.

Oh My Zsh

Install Oh my ZSH.

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

Install plugins.

  • autosuggesions plugin

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

  • zsh-syntax-highlighting plugin

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

  • zsh-fast-syntax-highlighting plugin

    git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting

  • zsh-autocomplete plugin

    git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git $ZSH_CUSTOM/plugins/zsh-autocomplete

Enable plugins by adding them to .zshrc.

  • Open .zshrc

    nvim ~/.zshrc

  • Find the line which says plugins=(git).

  • Replace that line with plugins=(git zsh-autosuggestions zsh-syntax-highlighting fast-syntax-highlighting zsh-autocomplete)

References

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