Skip to content

Using iTerm Dynamic Profiles

Posted on:June 6, 2024

I’ve recently begun to use neovim has my daily driver, largely in part to a series of videos by typecraft on YouTube. Since I’ve been using IntelliJ as my daily-driver for years, I have a lot of muscle memory that I’d rather not try to change.

Along with this, I’ve also recently started using tmux (again, due to typecraft, thanks nerd). So I’ve run into a lot of situations where I’d like to map some series of keys like “Cmd+Shift+O” to fuzzy-find a file in my cwd.

To facilitate this, I’ve been making extensive use of iTerm’s keymaps. Which are a really powerful way to customize iTerm to your liking/keyboard layout. This has been an excellent way to customize neovim, tmux, and my terminal interface to all feel like one cohesive unit.

The next level was to back up my keymaps to my dotfile repo so that I could just git pull my dotfiles and have my setup replicated on to any computer. Until this point, I had been copy-pasting my iterm profile when I started using a new computer, which was generally just a hassle that I felt could be automated.

I had a really hard time getting this functionality to work the way I wanted because my first attempt was backing up the com.googlecode.iterm2.plist file to git. Apple has a lot of strong preferences (get it?) about how you can utilize the preference list file, and does a bunch of fancy caching and stuff to make these snappy. As it also turns out, Apple does not allow symlinks in certain places anymore, and wouldn’t you know .plist files are one such thing MacOS will not let you symlink. The end result is that it’s difficult, though not totally impossible, to use git to back up your iterm preferences. It required a lot of arcane MacOS wizardry that didn’t even work half the time to invalidate plist caches, etc, etc.

Luckily there’s another way ✨

I would have sworn that I read the article on Dynamic Profiles at least a dozen times in the past, and it never clicked to me that this was the feature I wanted.

It’s so simple:

You’re done. You can now easily sync your profiles and keymaps across computers. 🤯

UPDATE: I also made a video about this process on YouTube.


Thanks for reading! If you enjoyed this, you may also enjoy following me on twitter!