Cheat sheets for Oh My Zsh

Cheat sheets for Oh My Zsh

#Reference

CommandDescription
tabsCreate a new tab in the current directory (macOS - requires enabling access for assistive devices under System Preferences).
takeCreate a new directory and change to it, will create intermediate directories as required.
x / extractExtract an archive (supported types: tar.{bz2,gz,xz,lzma}, bz2, rar, gz, tar, tbz2, tgz, zip, Z, 7z).
zsh_statsGet a list of the top 20 commands and how many times they have been run.
uninstall_oh_my_zshUninstall Oh-my-zsh.
upgrade_oh_my_zshUpgrade Oh-my-zsh.
exec zshApply changes made to zshrc
AliasCommand
aliaslist all aliases
..cd ..
...cd ../..
....cd ../../..
.....cd ../../../..
/cd /
~cd ~
cd +nswitch to directory number n
-cd -
1cd -
2cd -2
3cd -3
4cd -4
5cd -5
6cd -6
7cd -7
8cd -8
9cd -9
mdmkdir -p
rdrmdir
ddirs -v (lists last used directories)

See ~/.oh-my-zsh/lib/directories.zsh

Alias

example:

alias -s rb=vim #opens ruby files in vim
# $ foo.rb 
# vim => foo.rb
alias -g gp='| grep -i' #creates a global alias for grep
# $ ps ax gp ruby
# (all ruby process will be displayed)
FlagDescription
Lprint each alias in the form of calls to alias
glist or define global aliases
mprint aliases matching specified pattern
rlist or define regular aliases
slist or define suffix aliases

#Tab-completion

For options and helpful text of what they do
ls -(tab)
cap (tab)
rake (tab)
ssh (tab)
sudo umount (tab)
kill (tab)
unrar (tab)

#Git

Dynamic access to current branch name with the current`branch function
git pull origin $(current`branch)
grb publish $(current`branch) origin
AliasCommand
ggit
gagit add
gaugit add -u
gaagit add --all
gapagit add --patch
gbgit branch
gbagit branch -a
gbdgit branch -d
gblgit blame -b -w
gbnmgit branch --no-merged
gbrgit branch --remote
gbsgit bisect
gbsbgit bisect bad
gbsggit bisect good
gbsrgit bisect reset
gbssgit bisect start
gcgit commit -v
gc!git commit -v --amend
gcagit commit -v -a
gca!git commit -v -a --amend
gcan!git commit -v -a --no-edit --amend
gcans!git commit -v -a -s --no-edit --amend
gcamgit commit -a -m
gcsmgit commit -s -m
gcbgit checkout -b
gcfgit config --list
gclgit clone --recursive
gcleangit clean -id
gpristinegit reset --hard && git clean -dfx
gcmgit checkout master
gcdgit checkout develop
gcmsggit commit -m
gcogit checkout
gcountgit shortlog -sn
gcpgit cherry-pick
gcpagit cherry-pick --abort
gcpcgit cherry-pick --continue
gcsgit commit -S
gdgit diff
gdcagit diff --cached
gdctgit describe --tags `git rev-list --tags --max-count=1`
gdsgit diff --staged
gdtgit diff-tree --no-commit-id --name-only -r
gdwgit diff --word-diff
gfgit fetch
gfagit fetch --all --prune
gfogit fetch origin
gggit gui citool
ggagit gui citool --amend
ggpnpgit pull origin $(current_branch) && git push origin $(current_branch)
ggpullgit pull origin $(current_branch)
gglgit pull origin $(current_branch)
ggpurgit pull --rebase origin $(current`branch)
glumgit pull upstream master
ggpushgit push origin $(current_branch)
ggpgit push origin $(current_branch)
ggflgit push --force-with-lease origin /$(current_branch)
ggsupgit branch --set-upstream-to=origin/$(current_branch)
gpsupgit push --set-upstream origin $(current`branch)
gignoregit update-index --assume-unchanged
gignoredgit ls-files -v | grep "^[[:lower:]]"
git-svn-dcommit-pushgit svn dcommit && git push github master:svntrunk
gkgitk --all --branches
glgit pull
glggit log --stat --max-count = 10
glgggit log --graph --max-count = 10
glggagit log --graph --decorate --all
glogit log --oneline --decorate --color
gloggit log --oneline --decorate --color --graph
glp_git_log_prettily (git log --pretty=$1)
gmgit merge
gmagit merge --abort
gmtgit mergetool --no-prompt
gpgit push
gpoatgit push origin --all && git push origin --tags
grgit remote
grbgit rebase
grbagit rebase --abort
grbcgit rebase --continue
grbdgit rebase develop
grbmgit rebase master
grbsgit rebase --skip
grbigit rebase -i
grhgit reset HEAD
grhhgit reset HEAD --hard
grmvgit remote rename
grrmgit remote remove
grsgit restore
grsetgit remote set-url
grtcd $(git rev-parse --show-toplevel || echo ".")
grupgit remote update
grvgit remote -v
gsdgit svn dcommit
gspsgit show --pretty = short --show-signature
gsrgit svn rebase
gssgit status -s
gstgit status
gstagit stash save
gstaagit stash apply
gstdgit stash drop
gstlgit stash list
gstpgit stash pop
gstsgit stash show --text
gsugit submodule update
gtsgit tag -s
gunignoregit update-index --no-assume-unchanged
gunwipgit log -n 1 | grep -q -c "--wip--" && git reset HEAD~1
gupgit pull --rebase
gvtgit verify-tag
gwchgit whatchanged -p --abbrev-commit --pretty = medium
gwipgit add -A; git ls-files --deleted -z | xargs -r0 git rm; git commit -m "--wip--"

You also find these commands in Dash as a Cheat-sheet.

#Editors

AliasCommand
stt(When using sublime plugin) Open current directory in Sublime Text 2/3
v(When using vi-mode plugin) Edit current command line in Vim

#Symfony2

AliasCommand
sfphp ./app/console
sfclphp app/console cache:clear
sfcontainersf debug:container
sfcwsf cache:warmup
sfgbsf generate:bundle
sfroutesf debug:router
sfsrsf server:run -vvv

#tmux

AliasCommand
tatmux attach -t
tadtmux attach -d -t
tstmux new-session -s
tltmux list-sessions
tksvtmux kill-server
tksstmux kill-session -t

#Systemd

systemctl

CommandDescription
sc-status NAMEshow the status of the NAME process
sc-show NAMEshow the NAME systemd .service file
sc-start NAMEstart the NAME process
sc-stop NAMEstop the NAME process
sc-restart NAMErestart the NAME process
sc-enable NAMEenable the NAME process to start at boot
sc-disable NAMEdisable the NAME process at boot

#Rails

Rails Aliases

AliasCommand
rcrails console
rcsrails console --sandbox
rdrails destroy
rdbrails dbconsole
rgrails generate
rgmrails generate migration
rprails plugin
rurails runner
rsrails server
rsdrails server --debugger
rsprails server --port

RAILS`ENV Aliases

AliasCommand
REDRAILS`ENV=development
REPRAILS`ENV=production
RETRAILS`ENV=test

#Upgrade

To upgrade .oh-my-zsh, run:

upgrade_oh_my_zsh
Loading...