Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bulk remove iTerm2 color schemes.
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all.
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one.
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files.
$ cd /tmp/
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist .
$ plutil -convert xml1 com.googlecode.iterm2.plist
$ vi com.googlecode.iterm2.plist
# Now remove the color schemes in the <key> and <dict> tags,
# to make it easier, record a macro in vi to remove the key (e.g: Desert/Solarized) using `dd`,
# and then remove its color dict with `dat` (delete around tag), and repeat the macro until
# all color schemes you want to delete is gone.
# Save the file, and copy it back:
$ cp com.googlecode.iterm2.plist ~/Library/Preferences/
# Note that iTerm2 has 'fallback' configuration in case something is wrong,
# You might want to remove them as well:
$ rm ~/Library/Preferences/iTerm2.plist
$ rm ~/Library/Preferences/net.sourceforge.iTerm.plist
# Now reload the configuration
$ cd ~/Library/Preferences/
$ defaults read com.googlecode.iterm2
# Restart iTerm, and check the color-scheme list in the Preferences menu, you shouldn't see the old color-schemes now.
@fmela

This comment has been minimized.

Copy link

commented Jun 4, 2014

This was useful to me. Thanks!

@lideo

This comment has been minimized.

Copy link

commented Nov 8, 2014

Very useful. Thank you!

@colepeters

This comment has been minimized.

Copy link

commented Jan 20, 2015

Super helpful. Thanks!

@asethwright

This comment has been minimized.

Copy link

commented Jan 28, 2015

You are awesome. Thanks for sharing.

@fresham

This comment has been minimized.

Copy link

commented Apr 16, 2015

👍 Thanks for sharing

@jjuarez

This comment has been minimized.

Copy link

commented Oct 27, 2015

Thanks for sharing this trick

@kepingwang

This comment has been minimized.

Copy link

commented Nov 19, 2016

Great. Thank you!

@benweatherman

This comment has been minimized.

Copy link

commented Jan 5, 2017

Saved a bunch of time, thank you!

@Akatsukishen

This comment has been minimized.

Copy link

commented Jan 23, 2017

Big thx.

@zazazack

This comment has been minimized.

Copy link

commented Feb 9, 2017

This isn't necessarily easier, but as an alternative for those who prefer to use GUI: Open the plist file with Xcode and use the plist editor to delete the desired key/value pairs under the 'Color Custom Presets' property.

@shunhuahan

This comment has been minimized.

Copy link

commented May 7, 2017

thanks a lot!

@dx7

This comment has been minimized.

Copy link

commented May 10, 2017

👍

@AdrienGiboire

This comment has been minimized.

Copy link

commented May 29, 2017

Thanks!

@yangshiqi

This comment has been minimized.

Copy link

commented Jun 13, 2017

nice, 3q.

@amaurycatelan

This comment has been minimized.

Copy link

commented Aug 18, 2017

Yep, Very useful! 👍

@malikbenkirane

This comment has been minimized.

Copy link

commented Oct 16, 2017

very useful 👍

@neo1691

This comment has been minimized.

Copy link

commented Jan 16, 2018

Thank you. Saved a lot of my time.

@StevenXL

This comment has been minimized.

Copy link

commented Jul 8, 2018

This was exactly what I needed. Thank you.

@eproxus

This comment has been minimized.

Copy link

commented Apr 3, 2019

If you have Xcode installed you can edit the file directly. When iTerm2 is closed, run the following in Terminal.app:

$ open ~/Library/Preferences/com.googlecode.iterm2.plist

Then you get a nice GUI editor. Remove any desired color settings under the key Custom Color Presets, save the file and restart iTerm.

@9ft

This comment has been minimized.

Copy link

commented Apr 3, 2019

If you have Xcode installed you can edit the file directly. When iTerm2 is closed, run the following in Terminal.app:

$ open ~/Library/Preferences/com.googlecode.iterm2.plist

Then you get a nice GUI editor. Remove any desired color settings under the key Custom Color Presets, save the file and restart iTerm.

very useful

@raghavkarol

This comment has been minimized.

Copy link

commented Apr 16, 2019

Works great! thanks for sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.