First of all let me thank all the team for working on it! I was surprised how smoothly it runs and handles my current nvim configuration almost without exceptions.
Oni Version: 0.3.4
Neovim Version (Linux only):
Operating System: MacOS Sierra 10.12.2
Yp shortcut is broken when oni.loadInitVim is set to true and init.vim contains the set clipboard=unnamed line.
Create the minimal oni-test-init.vim containing just this:
set clipboard=unnamed
Specify the configuration setting in the config.tsx as following:
...
"oni.loadInitVim": "/path/to/oni-test-init.vim"
...
Restart Oni. In any text editing window:
test
The issue is not critical. There is a workaround:
if !exists("g:gui_oni")
set clipboard=unnamed
endif
But very annoying when you hit it for the first time.
Once again thank you for working on it!
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.
Hi, @zindel !
Thanks for logging this!
Personally, I suffered with this issue up until now and kept wishing it to be fixed.
Just tried your solution and it seems to work great!
@bryphe, do you think Oni should handle it on boot?
I think of something like:
if ((clipboard == 'unnamed' || clipboard == 'unnamedplus') &&
SOME_USER_CONFIG_THAT_DEFAULT_TO_TRUE) {
clipboard = '' // I think that this is the default value
}
Well, after a day of work w/o set clipboard=unnamedplus I am at a loss.
This setting is a life-quality requirement, but so is the the validity of yyp, yyP, ddP etc.
Anyone has an idea of how to fix this so that both will work at the same time?
@TalAmuyal what is the problem you are getting? Selection works well for me inside Oni & the console nvim as well. I am on MacOS though
I use Mac too.
The issue is thus:
If I set clipboard to unnamedplus then
<CMD-C> in Google Chrome and p in OniOn the other hand, if I remove the setting of clipboard then
I want both having "line-wise copy-paste inside Oni work as expected" and "the ability to freely copy-paste between Oni and the rest of the OS".
So, just verified on my own, here is what I am getting:
:set clipboard in Oni, I get clipboard=Y in OniCmd+V in Chrome Works!Cmd+C in Chromep Doesn't work, getting the context of the last deleted line in OniCmd+V Works! Getting content of the Chrome selectionSo, the issue exists, but as usually, there is a workaround :)
Just tried setting "editor.clipboard.enabled": false, in Oni's config and it seems to work fine with set clipboard=unnamedplus.
Will give it a try for a work-day or two and will report back.
Glad there is a workaround! Let me know if that doesn't work, @TalAmuyal . And thanks for the kind words and thoughtful investigation, @zindel !
I'm guessing that there is some interplay here:
https://github.com/onivim/oni/blob/a34e1d64ecf529f2d31f5f0bbb9cc33c4d19980e/browser/src/Editor/NeovimEditor/NeovimEditor.tsx#L423
When editor.clipboard.enabled is true, Oni on yank will set the clipboard directly. It might be that it's not properly passing up a new line or paving the clipboard. A potential fix might be to ditch this behavior if the user explicitly sets clipboard - if a user explicitly sets clipboard, we can assume they know exactly what behavior they want.
The only downside is there is a complicated interplay of settings between editor.clipboard.enabled and set clipboard - perhaps there is a way we could streamline this or make it more intuitive?
Got a private branch with a fix, will post a PR soon.
PR: https://github.com/onivim/oni/pull/2298
Will appreciate feedback for for the code-change and for actual functionality :)
Should be fixed now in master.
Please note if there are more inconsistencies.
Most helpful comment
Got a private branch with a fix, will post a PR soon.