Install and update
sh -c "$(curl -fsSL
https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Install with curl
The installer renames an existing .zshrc to
.zshrc.pre-oh-my-zsh.
omz update
Update Oh My Zsh now
omz reload
Reload the shell config
Runs exec zsh. Prefer it over source ~/.zshrc.
uninstall_oh_my_zsh
Uninstall and restore old shell config
omz help
List omz commands
zstyle ':omz:update' mode auto
Update without asking
Modes: auto, reminder, disabled. Put it in .zshrc before Oh My
Zsh loads.
zstyle ':omz:update' frequency <days>
Days between update checks
zstyle ':omz:update' cooldown <days>
Only apply updates this old
Plugins
plugins=(git z extract)
Enable plugins in .zshrc
omz plugin list
List available plugins
omz plugin enable <name>
Add a plugin to .zshrc
omz plugin disable <name>
Remove a plugin from .zshrc
aliases
List aliases of enabled plugins
Needs the aliases plugin.
sudo plugin: Esc Esc
Prefix the command line with sudo
extract <file>
Unpack most archive formats
Needs the extract plugin.
copypath [<path>]
Copy absolute path to clipboard
copybuffer plugin: Ctrl+O
Copy the current command line
z <part-of-dir>
Jump to a frequently used dir
Needs the z plugin.
git clone <repo>
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/<name>
Install an external plugin
Then add <name> to plugins=(). Autosuggestions and
syntax-highlighting are installed this way.
Navigation
.. / ... / ....
Go up 1, 2, 3 directories
Also ..... for four levels.
-
Back to the previous directory
d
List recent directories, numbered
Alias of dirs -v.
1 ... 9
Jump to the nth recent directory
Runs cd -<n>.
mkcd <dir>
Make dir (with parents) and enter
take <dir|url>
mkcd, or fetch/clone a .git or tar URL
zsh_stats
20 most used commands
alias
List all defined aliases
Git plugin aliases
ga <file> / gaa
git add / add --all
gcmsg "<msg>"
git commit --message
gcam "<msg>"
commit --all --message
gco <branch>
git checkout
gcb <branch>
git checkout -b
gsw <branch> / gswc <branch>
git switch / switch -c
gcm
Check out the main branch
gpf
Force push with lease
gpsup
Push and set upstream to origin
gfa
Fetch all, with tags, pruned
glog
Oneline decorated graph log
grb / grbi
git rebase / interactive
gsta / gstp
Stash push / stash pop
grst <file>
git restore --staged
grhh
git reset --hard
Discards local changes.
gpristine
Hard reset plus clean -dfx
Destructive: removes untracked and ignored files.
gwip / gunwip
Commit all as WIP / undo that commit
grt
cd to the repository root