Skip to content

Instantly share code, notes, and snippets.

@caillou
Last active January 10, 2022 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caillou/adf85eca6318b2d189d7e7af39b332ed to your computer and use it in GitHub Desktop.
Save caillou/adf85eca6318b2d189d7e7af39b332ed to your computer and use it in GitHub Desktop.

ZSH Configuration

brew install zsh pure fzf

# install "Oh My ZSH!"
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

git clone git@github.com/zdharma-continuum:fast-syntax-highlighting.git \
    ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
  
git clone git@github.com:olets/zsh-abbr.git \
    ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-abbr
  
git clone git@github.com:zsh-users/zsh-autosuggestions \
    ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

Edit the .zshrc theme as folloing:

ZSH_THEME=""

autoload -U promptinit; promptinit
prompt pure

Edit the plugins section of .zshrc as follows:

plugins=(zsh-autosuggestions fzf ssh-agent zsh-abbr nvm docker z fast-syntax-highlighting)

Add the following abbreviations:

abbr e=code
abbr gb='git branch --sort=-committerdate'
abbr gc='git checkout'
abbr gd='git diff --color-words'
abbr ggl='git pull origin $(git_current_branch)'
abbr ggp='git push origin $(gitcurrent_branch)'
abbr glog='git log --decorate --graph --oneline'
abbr gs='git status'
abbr j=z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment