As always, it’s best to do this before you start creating and
configuring qubes.
In that case you can make the change in /etc/skel/.vimrc in the
template, and every qube created afterwards using that template will
pick up the configuration.
If you have already created numerous qubes this wont fly - they already
have their own /home/user and wont be affected by changes to the
template. You must make the change in the individual qubes.
You can do this in salt.
Create /srv/salt/vim in dom0 and create the vimrc file there -
/srv/salt/vim/vimrc
/srv/salt/vim/vim.top
base:
'*':
- vim.vim
/srv/salt/vim/vim.sls
vim:
pkg.installed
/home/user/.vimrc:
file.managed:
- source: salt://vim/vimrc
Then:
qubesctl --skip-dom0 --targets=TARGET_LIST state.apply vim.vim
The “top” file is used for targeting - it uses a wildcard * in this
case.
The state file describes what we want - the vim pkg installed, and /home/user/.vimrc
created from the vimrc source file. (pkg.installed will use the
appropriate package manager for the qube you have targeted.)
This is very simple, but fine.
You can leverage salt to deliver different vimrc files to
different qubes, depending on what other packages are installed, or what
tags they have, and to automatically configure vimrc in different places
depending on whether the target is a template or a template based qube.
Make sure you understand the basics before moving on.