0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

iTermのタブに名前を自動でつけてどのリポジトリ触っているか一目でわかるようにする

Last updated at Posted at 2018-12-04
  • 仕事ではGitLabを使っているので、リポジトリは.../<group名>/<repository名>という形式で開発マシン上にある
  • iTermでそれぞれのレポジトリをタブごとに開いて作業
  • コーディングはvim + NERDTreeが基本、コマンド叩きたくなったらvimの中でterminal開く

という作業環境なので、以下の関数を.zshrcに定義しておくと、作業しているgroupとrepositoryが分かりやすい。

precmd() {
  # カレントディレクトリ+一つ上まで表示
  echo -ne "\e]1;${PWD#"${PWD%/*/*}/"}\a"
}
0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?