ctrl+v doesn't work
How to reproduce
- Copy some text to clipboard
- open terminal / browser in oni
- Paste copied text to terminal / browser with
ctrl+vorctrl+shift+v
oni 0.32, linux mint
Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.
In Vim (and thus in Neovim and Oni), Ctrl+v is column-selection.
Pasting is done using p or P.
Do you have some special configs to change this behaviour?
BTW, I like setting set clipboard+=unnamedplus in my init.vim to make Vim use the clipboard.
Yes, the vim way should be:
Visual mode: "+p or "*p
Insert mode: <C-r>+ or <C-r>*
I don't think we should have a C-v mapping.
@SpaceWhite's issue is a bit different though, it's copying, in this case you select the text in visual mode and use "*y or "+y.
In Linux * is the X selection clipboard and + is the normal clipboard. Not sure of other OSs.
Not sure if this is related to Oni though, seems like an issue using the normal clipboard.
If your terminal is gnome-terminal use Ctrl-Shift-v to paste from the clipboard.
Let us know if you find an issue with Oni and we'll reopen the issue.
Actually, we do already have this by default in Oni so it should work.
The bindings are as follows (and a mac version that I've left out):
if (config.getValue("editor.clipboard.enabled")) {
input.bind("<c-c>", "editor.clipboard.yank", isVisualMode)
input.bind("<c-v>", "editor.clipboard.paste", isInsertOrCommandMode)
}
So c-v should work in both Insert mode and in the command line, which it apparently is not.
That said, we could be having an issue with interfacing with the system clipboard on Linux or possibly Mint specifically. I'll test it out on my Arch/Ubuntu VMs and see how they fair.
EDIT: I'm not able to reproduce this on Ubuntu at least, so it may not be a linux issue. It could be related to either your keyboard (though its unlikely since its only c-v), or as said before a clipboard issue.
@CrossR Were you able to reproduce the issue?
@badosu Actually oni has paste from clipboard feature that can be triggered with ctrl+v key. Although this only works in editor mode, not in terminal mode and browser mode. It would be great if there is ctrl+v mode too in terminal and browser mode.
@CrossR I think ctrl+v key binding only works in vim insert mode. As @TalAmuyal mentioned ctrl+v in normal mode is column selection. But in browser and terminal, one can't use insert mode. Probably that's why the paste from clipboard didn't work.
But in browser and terminal, one can't use insert mode. Probably that's why the paste from clipboard didn't work.
Whoops, I somehow mentally corrected that to the command line, not the terminal. Yep, I can reproduce this now.
The paste is gated with this check:
const isInsertOrCommandMode = () =>
editors.activeEditor.mode === "insert" || editors.activeEditor.mode === "cmdline_normal"
I guess the terminal isn't working since the mode never swaps to insert and its not the cmdline....That could be a bit more awkward to fix though.
Browser should be a bit easier at least, and I think is a bug? (Or more likely just wasn't added yet!)
Oh, I got it now. I never used the terminal functionality, sorry about that. I thought you were having issues pasting to a different application.
You can append your init.vim with runtime mswin.vim, and you can copy/paste contents by ctrl+c/v