color scheme setup for iTerm

0

1

How do you setup color scheme of iTerm on Mac? For color scheme, I mean using different color to display folder name, file name, machine name, etc.

thanks in advance, Lin

Lin Ma

Posted 2015-05-08T23:13:19.923

Reputation: 181

Answers

1

Open up iTerm2.

Select iTerm menu > Preferences…

Go to the Profiles tab.

Pick a profile (or make a new one) then select the Colors tab (see the screen shot).

Colors tab in Profiles tab in iTerm2 preferences

You can then set the colours how you want them for that profile.

If you want to use those colours in another profile, click the Load Presets… drop down menu and then select Export… at the end of the menu. You can then save your colour scheme as an .iterm2colors file.

An .iterm2colors file is just an XML file, so you can open them up in a text editor and have a look at them.

For example, here is the XML for the Tomorrow Night Eighties scheme (via the Tomorrow Theme repo):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Ansi 0 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.0</real>
        <key>Green Component</key>
        <real>0.0</real>
        <key>Red Component</key>
        <real>0.0</real>
    </dict>
    <key>Ansi 1 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.47843137254901957</real>
        <key>Green Component</key>
        <real>0.46666666666666667</real>
        <key>Red Component</key>
        <real>0.94901960784313721</real>
    </dict>
    <key>Ansi 10 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.59999999999999998</real>
        <key>Green Component</key>
        <real>0.80000000000000004</real>
        <key>Red Component</key>
        <real>0.59999999999999998</real>
    </dict>
    <key>Ansi 11 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.40000000000000002</real>
        <key>Green Component</key>
        <real>0.80000000000000004</real>
        <key>Red Component</key>
        <real>1</real>
    </dict>
    <key>Ansi 12 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.80000000000000004</real>
        <key>Green Component</key>
        <real>0.59999999999999998</real>
        <key>Red Component</key>
        <real>0.40000000000000002</real>
    </dict>
    <key>Ansi 13 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.80000000000000004</real>
        <key>Green Component</key>
        <real>0.59999999999999998</real>
        <key>Red Component</key>
        <real>0.80000000000000004</real>
    </dict>
    <key>Ansi 14 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.80000000000000004</real>
        <key>Green Component</key>
        <real>0.80000000000000004</real>
        <key>Red Component</key>
        <real>0.40000000000000002</real>
    </dict>
    <key>Ansi 15 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.99999129772186279</real>
        <key>Green Component</key>
        <real>0.99997437000274658</real>
        <key>Red Component</key>
        <real>1</real>
    </dict>
    <key>Ansi 2 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.59999999999999998</real>
        <key>Green Component</key>
        <real>0.80000000000000004</real>
        <key>Red Component</key>
        <real>0.59999999999999998</real>
    </dict>
    <key>Ansi 3 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.40000000000000002</real>
        <key>Green Component</key>
        <real>0.80000000000000004</real>
        <key>Red Component</key>
        <real>1</real>
    </dict>
    <key>Ansi 4 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.80000000000000004</real>
        <key>Green Component</key>
        <real>0.59999999999999998</real>
        <key>Red Component</key>
        <real>0.40000000000000002</real>
    </dict>
    <key>Ansi 5 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.80000000000000004</real>
        <key>Green Component</key>
        <real>0.59999999999999998</real>
        <key>Red Component</key>
        <real>0.80000000000000004</real>
    </dict>
    <key>Ansi 6 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.80000000000000004</real>
        <key>Green Component</key>
        <real>0.80000000000000004</real>
        <key>Red Component</key>
        <real>0.40000000000000002</real>
    </dict>
    <key>Ansi 7 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.99999129772186279</real>
        <key>Green Component</key>
        <real>0.99997437000274658</real>
        <key>Red Component</key>
        <real>1</real>
    </dict>
    <key>Ansi 8 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.0</real>
        <key>Green Component</key>
        <real>0.0</real>
        <key>Red Component</key>
        <real>0.0</real>
    </dict>
    <key>Ansi 9 Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.47843137250000001</real>
        <key>Green Component</key>
        <real>0.46666666670000001</real>
        <key>Red Component</key>
        <real>0.94901960780000005</real>
    </dict>
    <key>Background Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.1764705882352941</real>
        <key>Green Component</key>
        <real>0.1764705882352941</real>
        <key>Red Component</key>
        <real>0.1764705882352941</real>
    </dict>
    <key>Bold Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.80000000000000004</real>
        <key>Green Component</key>
        <real>0.80000000000000004</real>
        <key>Red Component</key>
        <real>0.80000000000000004</real>
    </dict>
    <key>Cursor Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.80000000000000004</real>
        <key>Green Component</key>
        <real>0.80000000000000004</real>
        <key>Red Component</key>
        <real>0.80000000000000004</real>
    </dict>
    <key>Cursor Text Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.1764705882</real>
        <key>Green Component</key>
        <real>0.1764705882</real>
        <key>Red Component</key>
        <real>0.1764705882</real>
    </dict>
    <key>Foreground Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.80000000000000004</real>
        <key>Green Component</key>
        <real>0.80000000000000004</real>
        <key>Red Component</key>
        <real>0.80000000000000004</real>
    </dict>
    <key>Selected Text Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.80000000000000004</real>
        <key>Green Component</key>
        <real>0.80000000000000004</real>
        <key>Red Component</key>
        <real>0.80000000000000004</real>
    </dict>
    <key>Selection Color</key>
    <dict>
        <key>Blue Component</key>
        <real>0.31764705882352939</real>
        <key>Green Component</key>
        <real>0.31764705882352939</real>
        <key>Red Component</key>
        <real>0.31764705882352939</real>
    </dict>
</dict>
</plist>

You can download many colour schemes for iTerm2 at the iTerm 2 Color Schemes website. That might save you some time. :)

user150301

Posted 2015-05-08T23:13:19.923

Reputation:

Actually, reading back your question, this may not be the right answer. If you want to change the colours for the shell prompt (e.g. the user@computer ~> thing) then you may need to do further tweaking. This article is a good starting point for customising with the shell prompt, adding colours, etc.: http://www.ibm.com/developerworks/linux/library/l-tip-prompt/. Also see this answer to another iTerm2 question: http://superuser.com/a/896597/150301.

– None – 2015-06-12T09:32:55.150

if I want to use color profile setting from another iTerm2 on another computer, how to save the color scheme preference on another computer and copy over? Thanks. – Lin Ma – 2015-06-18T00:25:13.667