Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. @dedy-purwanto dedy-purwanto revised this gist Apr 26, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -26,6 +26,7 @@ $ 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.
  2. @dedy-purwanto dedy-purwanto created this gist Apr 26, 2014.
    31 changes: 31 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    # 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

    $ 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.