Skip to content

Instantly share code, notes, and snippets.

@denhamparry
Last active September 1, 2018 06:50
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 denhamparry/559935c216917357ca7e20523e993157 to your computer and use it in GitHub Desktop.
Save denhamparry/559935c216917357ca7e20523e993157 to your computer and use it in GitHub Desktop.
oh my zsh notes

Oh My Zsh Notes

Based on macOS

Links

Reset

To sh

$ chsh -s /bin/sh

To zsh

$ chsh -s /bin/zsh

Reload zsh

$ source ~/.zshrc

Install

Homebrew

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

iTerm2

https://iterm2.com/downloads.html

zsh

brew install zsh

oh-my-zsh

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

Update iTerm2

Update Colours

$ cd Downloads
$ curl -O https://raw.githubusercontent.com/MartinSeeler/iterm2-material-design/master/material-design-colors.itermcolors
  • Open iTerm2 > Preferences
  • Select Profiles > Colors > Color Presets > Import
  • Select material-design-colors.itermcolors from the Downloads folder
  • Select material-design-colors from the Color Presets dropdown

Manage Plugins

vi ~/.zshrc
  • Type “/plugin” (without quotes) press enter, type ‘i’ character and insert the plugin that you want to add
  • Add docker to plugins
plugins=(
  sudo
  history
  taskwarrior
  tmux
  tmuxinator
  git
  docker
)

Using zsh frameworks

  • Clone the repository inside your oh-my-zsh repo:
git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions
  • Enable it in your .zshrc by adding it to your plugin list and reloading the completion:
  plugins=(
    …
    zsh-completions
  )
  autoload -U compinit && compinit

Git Repos for plugins:

Add An Alias (Permanent Alias)

vi ~/.zshrc
.
.
.
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias dkps="docker ps"
alias dkst="docker stats"
alias dkpsa="docker ps -a"
alias dkimgs="docker images"
alias dkcpup="docker-compose up -d"
alias dkcpdown="docker-compose down"
alias dkcpstart="docker-compose start"
alias dkcpstop="docker-compose stop"
  • Type ‘dkps’ it will be execute ‘docker ps’
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment