This exists in VSCode, it's called workspaces. You save a .workspace file, then with either an extension like this one[1] bound a key (very easy to do), or just using the command pallette to open it, you can switch to any workspace you want; in the same window or a new window, and you can have the exact files/layout/tabs you had open the last time you were using that workspace open automatically.
It's very simple. It's certainly more simple from first principles than your method, but if you are adept at using the shell as you clearly are, then your 'fg && vim ctrl-p` certainly must feel pretty natural; but I hope you understand that this is only because you have probably lived on the shell for many years. I used to do that too, with tmux and vim configs, but now I find it much simpler, faster, and better to use VSCode. I'm not saying you should switch, I'm only saying that just because it's not on the shell doesn't mean it's worse.
It's very simple. It's certainly more simple from first principles than your method, but if you are adept at using the shell as you clearly are, then your 'fg && vim ctrl-p` certainly must feel pretty natural; but I hope you understand that this is only because you have probably lived on the shell for many years. I used to do that too, with tmux and vim configs, but now I find it much simpler, faster, and better to use VSCode. I'm not saying you should switch, I'm only saying that just because it's not on the shell doesn't mean it's worse.
[1] https://marketplace.visualstudio.com/items?itemName=sadesyll...