Is there a keyboard shortcut to alternate between color schemes in iTerm2
Solution 1:
This works on iTerm2 (version, 3.0.8 through 3.0.13)
- In iTerm's preferences, select the
keys
tab. - There's a table called
key mappings
- click on the
+
at the bottom of the table
- click on the
- Choose a keyboard shortcut
- From the dropdown menu, choose the
load color preset
option - You'll get another dropdown menu to choose the color preset you want
)
It works across all panes and windows and its setting is persistent across sessions.
Solution 2:
I found another solution from this site:
Declare a function in your .bashrc
or .zshrc
:
it2prof() { echo -e "\033]50;SetProfile=$1\a" }
Then you can switch profile from CLI with it2prof ProfileName
Solution 3:
Note: This is not a complete solution, since it isn't entirely keyboard based, but it's the fastest method I have found to switch between color schemes. Hopefully others find it useful.
- Create a profile for each color scheme you want to use (
iTerm -> Preferences -> Profiles
) - Switch between profiles in your current session (
Command-I
orView -> Edit Current Session
)
One keyboard chord and one mouse click.