Running multiple versions of arduino IDE with different preferences.txt

I'd like to run 3 version of the arduino IDE, one for ESP32, one for teensy, and one for ESP8266 so that I can recompile for all 3 quickly without having to switch back and forth.
I can do that just fine right now, except they all share the same preferences.txt, which is annoying as they save settings on top of one another (CPU used, port to flash on, and last files used).

Is there an easy way to patch 2 of those IDEs so that they use something else than ~/.arduino15/preferences.txt ?

The easiest way to do it is by running the Arduino IDEs in portable mode by creating a folder named "portable" under the Arduino IDE installation folder. That will cause the preferences.txt file to be saved under each IDEs portable folder.

More information:

This worked great, thank you.

You're welcome. I'm glad if I was able to be of assistance. Enjoy!
Per