Open Git's man pages wisely · 5f5c909 · aereal/dotfiles · GitHub
Git の man はサブコマンドごとに分割されている。たとえば git filter-branch
だと man git-filter-branch
のような。
ただ、普段ハイフンを入れないところに入れるのは戸惑うので man git filter-branch
とかでもいいように man を開きたい。
function subcommand_man() { case "$1" in git) command man "${(j:-:)@}" ;; *) command man "$@" esac }
zsh スクリプトでこういう関数を定義する。
subcommand_man git filter-branch
とすると git-filter-branch の man が開ける。
手抜きなので section 指定とかできないけどこれで満足した。
zsh で Git の man を素早く見る - Qiita [キータ]
ところでこういうのがあって zsh を使っているのならこれを使うほうが便利そう。