Hello, vim and neovim on my system seem to lack the ability to communicate with the qubes-clipboard which significantly hinders my workflow whenever I have to paste information. IMO my solution lies in a custom clipboard configuration, however upon looking through the documentation I find no mention of command line copy and paste options of this ilk and I can’t read src well enough to implement this. Any suggestions / solutions are highly appreciated.
You could adjust the global clipboard (“secure copy and paste keyboard”) shortcuts in /etc/qubes/guid.conf to your liking.
checking it out now ![]()
it looks like this is an unused config feature: file header:
EDITING THIS FILE WILL NOT HAVE ANY EFFECT! It is not read by the GUI daemon
anymore, and is left here for reference only. To configure the GUI daemon,
use qvm-features (see ‘man qvm-features’ for details)
this option seems to be what you referenced and would be external to the process of hooking a vms internal clipboard up given the app would hook to the vms clipboard not the global clipboard, I might be able to poke around and find a file path for the vm’s clipboard. If that is how any of this works that is anyway.
qvm-features dom0 gui-default-secure-copy-sequence 'Mod4-c'
qvm-features dom0 gui-default-secure-paste-sequence 'Mod4-v'
Maybe you already know that, but I think that you need a vim/neovim plugin so that yanking/pasting merges with the system-wide (vm) clipboard. Otherwise it’s using a vim-specific clipboard. Then you can use shift+ctrl+C, shift+ctrl+V as normal to copy between VMs.
As far as I remember, LazyVim works out of the box if that’s an option.
It would be useful if you explained how it is that you are using vim,
what you want to happen, and what terminal emulator you are using.
“command line copy and paste” is somewhat unclear.
The reason is that this likely depends on DE,TE, and vim version.
The vim version shipped with debian does not have clipboard support - check
:echo has('clipboard')
But you can still have some copy/paste by using features in the terminal,
eg setting Xterm*selectToClipboard:true, then selection in xterm uses the
standard clipboard.
I’m using xfce terminal with
NVIM v0.10.0-dev-2982+gea1c9f60e
Build type: RelWithDebInfo
LuaJIT 2.1.1713484068
basically default Nvchad config,
When i use tmux I can copy and paste without configuring clipboard integration options. ![]()
Back when I posted this I didn’t have xclip installed, I tried using minimal-templates as a new linux user and didn’t install all of the packages I needed to actually use a clipboard hence me not being able to use the clipboard. There was no Issue with neovim clipboard support it was just me not knowing the technology I was making use of well enough to figure out a simple issue.
If you install the package vim-gtk3 in Debian you will have clipboard support also in the non-gui vim.
@dhimh Do you know if vim-gtk3 works only for gnome debian-12, but not xfce debian-12?
I’m running debian-12-xfce, and with the default vim, I can’t use cont + shift + C to copy.
vim --version | grep clipboard returns -clipboard -xterm_clipboard
So I installed vim-gtk3. Now vim --version | grep clipboard returns +clipboard +xterm_clipboard
But cont + shift + C keyboard shortcut doesn’t work as expected to copy text out of vim into a terminal elsewhere. I’m using xfce4-terminal if it’s relevant. Any insight is greatly appreciated.
Could you make it clear how you copy-paste exactly? What do you do inside vim? Outside? In which qube? If the global shortcuts are modified? And what do you expect vs what is happening?
If cont=Ctrl, that key combo is used by Qubes and will be captured by
dom0.
You can either change the global shortcut, or change the shortcut you
are using to copy from in the terminal.
I never presume to speak for the Qubes team.
When I comment in the Forum I speak for myself.
Hi @unman, I should have mentioned that I mapped the QubesOS copy and past functions to windows key + C and windows key + V via Qubes Global Config tool. With my QubesOS set up, Ctrl + Shift + C and Ctrl + Shift + V works as expected on fedora based VMs to copy and paste between Vim and terminals. It’s just the Debian based VMs that aren’t behaving as expected.
It works for me. After installing vim-gtk3 in an otherwise unmodified debian-12-xfce template the result of
:echo has('clipboard')
is 1 and yanking into the system clipboard register (with "+y) / pasting from the system clipboard register (with "+p) works as expected.
On Debian you can try to hold down the shift key while selecting the text. Ctrl + Shift + C should work then (it works for me e.g. with vim and tmux). It has the advantage that it doesn’t depend on (neo)vim clipboard support, and the disadvantage that this way line numbers etc. are copied, too. With "+y just the selected file content is copied which is usually what you want.
Hmmmm. If I type some text into the xfce4-terminal command line, and highlight it, I can use Ctrl + Shift + C to copy it. Then if I open a text file with vim-gtk3, press ‘i’ to enter insert mode, I can use Ctrl + Shift + V to paste what I copied from the xfce4-terminal earlier. And I can paste it multiple times. But inside vim-gtk3, I can’t use Ctrl + Shift + C to copy text. After using Ctrl + Shift + C in vim-gtk3, the clipboard appears cleared if I try and paste anything into xfce4-terminal command line.
At this point, I wonder if it’s some sort of hardware quirk with the keyboard (it uses a USB connection). It’s the only keyboard I have to test with this computer though… Regardless, it’s not the end of the world.
You can try to copy/paste with Ctrl+Insert/Shift+Insert.