Sheharyar Naseer

Sync your iTerm2 Settings and Configs between devices

Last month I wrote about Customizing your iTerm2 to look beautiful, and even before that I’ve changed a lot of other settings that I don’t want to lose when I switch to another mac. Luckily, iTerm lets you specify where to save your Terminal settings.

Open iTerm2 settings (⌘,) and go to General > Preferences. Enable both of the options, and specify the folder where you want to save them:

Save iTerm2 Settings

You can choose a location in your local installation of Dropbox or Google Drive, so the configs are automatically synced between all of your devices – but I prefer placing them in my Dotfiles so I can explicitly commit and push them instead. This way I always have the full history of my changes and I can manually resolve merge conflicts if there are any.

I’ve also found it helpful to specify the location from the shell directly:

# Specify the preferences directory
defaults write com.googlecode.iterm2 PrefsCustomFolder -string "~/.dotfiles/System/iTerm/settings"

# Tell iTerm2 to use the custom preferences in the directory
defaults write com.googlecode.iterm2 LoadPrefsFromCustomFolder -bool true

You can get my iTerm2 customizations and enabled themes here.