LoginSignup
17
15

More than 5 years have passed since last update.

tigカスタムキーバインド紹介(mainビューとbranchビュー編)

Last updated at Posted at 2014-01-31

やけに丁寧なtigの設定ガイド(キーバインド概論編) の続きで、筆者がよく使っているキーバインドのうち、mainビューとbranchビューで使っている主要な設定を紹介します。

########
# main view
########

# チーム開発しているとよくremoteで更新が入るため手元に同期
bind main ^r !git pull --rebase
# revert作業は手早く行う必要があるためバインドして効率化
bind main V !?git revert %(commit)
# 任意のリビジョンを再現するためにcheckoutすることが多いためバインド
bind main C !?git checkout %(commit)

########
# branch view
########

# リモートブランチをtrackしつつチェックアウト
bind branch T !git checkout -t %(branch)
# カーソル行のブランチを親にして入力した名前のブランチを作成
bind branch n !git checkout -b %(prompt) %(branch)
# 不要になったブランチを削除(squash mergeや別リポジトリへのmergeをするワークフロー用)
bind branch D !?git branch -D %(branch)
# 不要になったブランチを削除
bind branch d !?git branch -d %(branch)
# originへのpush
bind branch P !git push -u origin %(branch)

筆者自身のいま持っている課題感としては、git reset周りがバインドできていないことと、
branchのrebase周りがバインドできていないことが挙げられます。今後改善していきたいと思います。

17
15
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
17
15