0
0

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.

iTerm2の見た目を変更する(色を付ける)

0
Last updated at Posted at 2018-11-20

表示内容を変更し、色をつけるようにします。

参考リンク
https://qiita.com/varmil/items/9b0aeafa85975474e9b6

git-completion.bashが無い場合
http://cybermergina.hateblo.jp/entry/2018/05/25/182328

  1. git-completion.bash ファイルをgitフォルダと同じディレクトリに配置する。
    (gitフォルダ内ではないので注意)

  2. 同じディレクトリ内にある .bashrc ファイルに下記のソースを記述します。
    ※隠しファイルなので、macの場合は、command + shift + . で表示させます。

if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

ここから下を記述
iTermでブランチ名出す設定は、下記を記載してください

function git_ps() {
 git branch --no-color 2> /dev/null | sed -e 's/ //g' | sed -e '/^[^*]/d' -e 's/*\(.*\)/\1/'
}
export PS1='\[\033[00m\]\u@\h\[\033[00m\]:\[\033[32m\]\w\[\033[35m\] [$(git_ps)]\[\033[00m\]\$ '
// ここから上を記述

export PATH=/usr/bin/X11:$PATH

これで、現在のブランチを常に表示するようになり色付きにもなります。

色コードの変更は下記を参照に
https://qiita.com/wildeagle/items/5da17e007e2c284dc5dd

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?