If you have a look at Preferences -> General
you will notice at the bottom of the panel, there is a setting Load preferences from a custom folder or URL:
. There is a button next to it Save settings to Folder
.
So all you need to do is save your settings first and load it after you reinstalled your OS.
If the Save settings to Folder
is disabled, select a folder (e.g. empty) in the Load preferences from a custom folder or URL:
text box.
In iTerm2 3.3 on OSX the sequence is: iTerm2 menu, Preferences, General tab, Preferences subtab