A text editor[1] I wrote a while ago has a feature that allows you to compile and run any tab by pressing F5, even when that tab is not saved anywhere it will save it to /tmp and compile it for you.
It's a very simple feature that I'm sure can be implemented as a plugin in any IDE/Text editor. The Nim VS Code plugin sort of supports it, but the feature could be improved. (Nowadays, I wouldn't recommend using Aporia for various reasons).
1 - Aporia - https://github.com/nim-lang/Aporia