I’ve been struggling for the past few days to come up with a practical design for this. I’d like to have a consistent way of editing files, using the same vim environment. My vim environment is rather complex, as it consists not only of .vimrc, but also multiple plugins, and even a couple of system-level binaries, such as fzf (plus fonts and color schemes). The naive solution would be to copy all the dependencies of my vim setup to TemplateVMs, but it’s difficult to keep each individual TemplateVM up to date.
So instead, I’ve been thinking of creating an AppVM with just the vim environment. But now the problem is how to give it access to the files I need to work on.
There are some files that I know already I will need access to, e.g the repository of blog posts I write. For this, I can use the qubes-sync design, to store the documents on my “file store” qube and mount them in a folder in the Vim qube.
But I’m not sure about a practical way to access files from other, arbitrary AppVMs, on a per-need basis. For example, if I work on a coding project and I want to use a dedicated AppVM for it (so that its development environment is isolated), how would I then be able to use my Vim setup to edit the files in this new AppVM? Just by replicating the qubes-sync again and again, for the AppVM of each new project?
And what about unplanned, occasional situations, where I want to just edit for example a config file, from an arbitrary AppVM? How would I get this file into Vim, and then the changed version back to the original AppVM? I could use qvm-copy, but that would take a lot of steps: fill in the path name in AppVM, type in the Vim AppVM name in the prompt, start vim, navigate to the file in QubesIncoming and open, then when I finished editing it, repeat the first two steps again to get the file back into the original AppVM, plus move the changed file from QubesIncoming to its original location. I suppose all of this can be automated, although it would require some kind of signalling for when to trigger each phase. And what if I need to edit more than 1 file like that at the same time? Then the signalling, and maybe even the window management can get a bit messy. In this scenario, I think I’d prefer using a single running instance of vim, with different tabs/buffers for each file; that way using vim’s registers for copy/pasting would be possible too.
If anyone has thought before about creating a setup for similar use cases, please share your suggestions.