Made it easier to customize prompt colors. Change default color theme for iterm.

This commit is contained in:
Ivan Malison 2014-04-24 20:13:35 -07:00
parent 85caeba0b5
commit c92b886cd2
2 changed files with 101 additions and 71 deletions

View File

@ -29,9 +29,39 @@ function sandbox_prompt() {
fi
}
PROMPT='╭─% %{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(hostname -s)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}$(current_directory)%{$reset_color%}$(git_prompt_info)$(sandbox_prompt)
$FG[255]%{$reset_color%}╰─± '
function prompt_use_custom_colors() {
export USERNAME_COLOR="$FG[040]"
export SEPARATOR_COLOR="$FG[239]"
export HOSTNAME_COLOR="$FG[033]"
export CURRENT_DIRECTORY_COLOR="$FG[226]"
}
function prompt_use_basic_colors() {
export USERNAME_COLOR="$fg[blue]"
export SEPARATOR_COLOR="$fg[black]"
export HOSTNAME_COLOR="$fg[green]"
export CURRENT_DIRECTORY_COLOR="$fg[yellow]"
}
function prompt_grey_separator() {
export USERNAME_COLOR="$fg[blue]"
export SEPARATOR_COLOR="$FG[239]"
export HOSTNAME_COLOR="$fg[green]"
export CURRENT_DIRECTORY_COLOR="$fg[yellow]"
}
function print_with_color() {
echo "%{$2%}$1%{$reset_color%}"
}
function separator() {
print_with_color "$1" "$SEPARATOR_COLOR"
}
PROMPT='╭─% $(print_with_color "%n" "$USERNAME_COLOR") $(separator "at") $(print_with_color "`hostname -s`" "$HOSTNAME_COLOR") $(separator "in") $(print_with_color "`current_directory`" "$terminfo[bold]$CURRENT_DIRECTORY_COLOR")$(git_prompt_info)$(sandbox_prompt)
╰─± '
PS2=''
RPROMPT='Last Exit Code: $?'
prompt_use_custom_colors

View File

@ -4525,7 +4525,7 @@
<key>NSWindow Frame NSColorPanel</key>
<string>427 366 214 309 0 0 1920 1080 </string>
<key>NSWindow Frame Preferences</key>
<string>662 255 924 485 0 0 1920 1080 </string>
<string>86 531 924 485 0 0 1920 1058 </string>
<key>NSWindow Frame SUStatusFrame</key>
<string>768 697 384 129 0 0 1920 1058 </string>
<key>NSWindow Frame iTerm Window 0</key>
@ -4544,146 +4544,146 @@
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<real>0.45882353186607361</real>
<key>Green Component</key>
<real>0.0</real>
<real>0.45882353186607361</real>
<key>Red Component</key>
<real>0.0</real>
<real>0.45882353186607361</real>
</dict>
<key>Ansi 1 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<real>0.30196079611778259</real>
<key>Green Component</key>
<real>0.0</real>
<real>0.364705890417099</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
<real>0.50980395078659058</real>
</dict>
<key>Ansi 10 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<real>0.66666668653488159</real>
<key>Green Component</key>
<real>1</real>
<real>0.85098040103912354</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
<real>0.59607845544815063</real>
</dict>
<key>Ansi 11 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<real>0.61568629741668701</real>
<key>Green Component</key>
<real>1</real>
<real>0.90588235855102539</real>
<key>Red Component</key>
<real>1</real>
<real>0.98039215803146362</real>
</dict>
<key>Ansi 12 Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<real>0.81176471710205078</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<real>0.76470589637756348</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
<real>0.47843137383460999</real>
</dict>
<key>Ansi 13 Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<real>0.63137257099151611</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<real>0.69803923368453979</real>
<key>Red Component</key>
<real>1</real>
<real>0.83921569585800171</real>
</dict>
<key>Ansi 14 Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<real>0.87843137979507446</real>
<key>Green Component</key>
<real>1</real>
<real>0.87843137979507446</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
<real>0.67843139171600342</real>
</dict>
<key>Ansi 15 Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<real>0.87843137979507446</real>
<key>Green Component</key>
<real>1</real>
<real>0.87843137979507446</real>
<key>Red Component</key>
<real>1</real>
<real>0.87843137979507446</real>
</dict>
<key>Ansi 2 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<real>0.38431373238563538</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<real>0.54901963472366333</real>
<key>Red Component</key>
<real>0.0</real>
<real>0.44705882668495178</real>
</dict>
<key>Ansi 3 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<real>0.42745098471641541</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<real>0.63137257099151611</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
<real>0.67843139171600342</real>
</dict>
<key>Ansi 4 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<real>0.50980395078659058</real>
<key>Green Component</key>
<real>0.0</real>
<real>0.48235294222831726</real>
<key>Red Component</key>
<real>0.0</real>
<real>0.30196079611778259</real>
</dict>
<key>Ansi 5 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<real>0.40392157435417175</real>
<key>Green Component</key>
<real>0.0</real>
<real>0.44705882668495178</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
<real>0.54117649793624878</real>
</dict>
<key>Ansi 6 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<real>0.58039218187332153</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<real>0.58039218187332153</real>
<key>Red Component</key>
<real>0.0</real>
<real>0.44705882668495178</real>
</dict>
<key>Ansi 7 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<real>0.87843137979507446</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<real>0.87843137979507446</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
<real>0.87843137979507446</real>
</dict>
<key>Ansi 8 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<real>0.54117649793624878</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<real>0.54117649793624878</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
<real>0.54117649793624878</real>
</dict>
<key>Ansi 9 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<real>0.47843137383460999</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<real>0.57647061347961426</real>
<key>Red Component</key>
<real>1</real>
<real>0.81176471710205078</real>
</dict>
<key>Automatically Log</key>
<false/>
@ -4692,11 +4692,11 @@
<key>Background Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<real>0.20784313976764679</real>
<key>Green Component</key>
<real>0.0</real>
<real>0.20392157137393951</real>
<key>Red Component</key>
<real>0.0</real>
<real>0.14117647707462311</real>
</dict>
<key>Background Image Is Tiled</key>
<false/>
@ -4715,11 +4715,11 @@
<key>Bold Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<real>0.56470590829849243</real>
<key>Green Component</key>
<real>1</real>
<real>0.53333336114883423</real>
<key>Red Component</key>
<real>1</real>
<real>0.39215686917304993</real>
</dict>
<key>Character Encoding</key>
<integer>4</integer>
@ -4732,20 +4732,20 @@
<key>Cursor Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<real>0.47843137383460999</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<real>0.39215686917304993</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
<real>0.34117648005485535</real>
</dict>
<key>Cursor Text Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<real>0.19607843458652496</real>
<key>Green Component</key>
<real>1</real>
<real>0.19607843458652496</real>
<key>Red Component</key>
<real>1</real>
<real>0.19607843458652496</real>
</dict>
<key>Cursor Type</key>
<integer>2</integer>
@ -4766,11 +4766,11 @@
<key>Foreground Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<real>0.83137255907058716</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<real>0.90588235855102539</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
<real>0.83137255907058716</real>
</dict>
<key>Guid</key>
<string>3314520D-1E49-4605-AFCE-EA48A596636F</string>
@ -5112,20 +5112,20 @@
<key>Selected Text Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<real>0.074509806931018829</real>
<key>Green Component</key>
<real>0.0</real>
<real>0.54509806632995605</real>
<key>Red Component</key>
<real>0.0</real>
<real>0.61960786581039429</real>
</dict>
<key>Selection Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<key>Green Component</key>
<real>0.8353000283241272</real>
<real>1</real>
<key>Red Component</key>
<real>0.70980000495910645</real>
<real>1</real>
</dict>
<key>Semantic History</key>
<dict>