LoginSignup
128
115

More than 5 years have passed since last update.

oh-my-zshチートシート

Last updated at Posted at 2014-05-04

https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheetをかなり適当に日本語訳。
内容がかなり偏ってる気がする。


GitHubからcloneした場合、ホームディレクトリで以下を実行することでoh-my-zshがインストールされる。

  • source ~/.oh-my-zsh/templates/zshrc.zsh-template

コマンド

  • tab - カレントディレクトリで新しいターミナルタブを作成 (OSXの場合、システム環境設定で補助デバイスのアクセスを有効化する必要あり)
  • take - 新しいディレクトリを作成して移動 (必要なら階層的にディレクトリを作成)
  • x/extract - アーカイブを展開 (対応: tar.{bz2,gz,xz,lzma}, bz2, rar, gz, tar, tbz2, tgz, zip, Z, 7z).
  • zsh_stats - よく使うコマンドTop20とその使用回数のリストを出力
  • uninstall_oh_my_zsh - oh-my-zshをアンインストール
  • upgrade_oh_my_zsh - oh-my-zshをアップグレード

ディレクトリ操作

  • alias - 全てのエイリアスを出力
  • .. - cd ..
  • cd.. - cd ..
  • cd... - cd ../..
  • cd.... - cd ../../..
  • cd..... - cd ../../../..
  • cd/ - cd /
  • cd +n - n回前のディレクトリに移動
  • 1 - cd -
  • 2 - cd +2
  • 3 - cd +3
  • 4 - cd +4
  • 5 - cd +5
  • 6 - cd +6
  • 7 - cd +7
  • 8 - cd +8
  • 9 - cd +9
  • md - mkdir -p
  • rd - rmdir
  • d - dirs -v (直近に居たディレクトリの一覧を出力)

タブ補完

  • ls -(tab) - オプションと動作の説明
  • cap (tab)
  • rake (tab)
  • ssh (tab)
  • sudo umount (tab)
  • kill (tab)
  • unrar (tab)

Git

カレントブランチ名を自動的に挿入

  • git pull origin $(current_branch)
  • grb publish $(current_branch) origin

よく使うGitコマンドへのエイリアス

  • g - git
  • gst - git status
  • gl - git pull
  • gup - git pull --rebase
  • gp - git push
  • gd - git diff
  • gdc - git diff --cached
  • gdv - git diff -w "$@" | view
  • gc - git commit -v
  • gc! - git commit -v --amend
  • gca - git commit -v -a
  • gca! - git commit -v -a --amend
  • gcmsg - git commit -m
  • gco - git checkout
  • gcm - git checkout master
  • gr - git remote
  • grv - git remote -v
  • grmv - git remote rename
  • grrm - git remote remove
  • gsetr - git remote set-url
  • grup - git remote update
  • grbi - git rebase -i
  • grbc - git rebase --continue
  • grba - git rebase --abort
  • gb - git branch
  • gba - git branch -a
  • gcount - git shortlog -sn
  • gcl - git config --list
  • gcp - git cherry-pick
  • glg - git log --stat --max-count=10
  • glgg - git log --graph --max-count=10
  • glgga - git log --graph --decorate --all
  • glo - git log --oneline --decorate --color
  • glog - git log --oneline --decorate --color --graph
  • gss - git status -s
  • ga - git add
  • gm - git merge
  • grh - git reset HEAD
  • grhh - git reset HEAD --hard
  • gclean - git reset --hard && git clean -dfx
  • gwc - git whatchanged -p --abbrev-commit --pretty=medium
  • gsts - git stash show --text
  • gsta - git stash
  • gstp - git stash pop
  • gstd - git stash drop
  • ggpull - git pull origin $(current_branch)
  • ggpur - git pull --rebase origin $(current_branch)
  • ggpush - git push origin $(current_branch)
  • ggpnp - git pull origin $(current_branch) && git push origin $(current_branch)
  • glp - _git_log_prettily

エディタ

  • stt - カレントディレクトリをSublime Text 2で開く

Symfony2

  • sf - php app/console
  • sfcl - php app/console cache:clear
  • sfroute - php app/console router:debug
  • sfgb - php app/console generate:bundle
128
115
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
128
115