codemirror-vim
codemirror-vim copied to clipboard
Yanking And Pasting From System Clipboard
Can you please make "+y or *+y and "+p or *+p available, it is very important and basic command and yet not implemented from vim. I know there a command to tell the vim use system clipboard. But vim mess with clipboard a lot so it is better imo to not to do that and instead use a different command for that.
thanks
Browsers do not provide access to the selection clipboard so * can't work correctly. Should it be an alias for +, or should it just stay unimplemented?
I think it should stay unimplemented. On Windows an alias might make sense because they're the same clipboard, but not on Linux (and macOS; not 100% sure about that).
Some discusison of this in the past here: https://github.com/codemirror/codemirror5/issues/3075
I also found that as a consumer of the vim API you can add yanking to the system clipboard with these two snippets:
https://github.com/ianhi/jupyterlab-vimrc/blob/2dedaf7f48b7b3bd462defda77ae3865fbff70e9/src/index.ts#L34-L37 https://github.com/ianhi/jupyterlab-vimrc/blob/main/src/yank.ts
Some discusison of this in the past here: codemirror/codemirror5#3075
I also found that as a consumer of the vim API you can add yanking to the system clipboard with these two snippets:
https://github.com/ianhi/jupyterlab-vimrc/blob/2dedaf7f48b7b3bd462defda77ae3865fbff70e9/src/index.ts#L34-L37 https://github.com/ianhi/jupyterlab-vimrc/blob/main/src/yank.ts
i think this just set the clipboard to unnamed which i already use to solve the issue, but sometimes there is an app without any vimrc file to put it in, so a easier why to make copy pasting available is needed. i mean what is more important than that? i like to use vim everywhere i can find a plugin for it and many of them use code mirror to emulate it.
Closing since the + register works now, if there are additional feature requests please create a new issue.
Is there a way to use a Userscript to yank to the clipboard with <c-c>, @nightwing? It seems Overleaf hasn't implemented the new +-registry patch yet.
It's a very simple implementation, see this comment: https://github.com/replit/codemirror-vim/pull/36#issuecomment-1186192936
@kometenstaub Thanks for the pointer. Though, from an end-user perspective, are you suggesting that I should find a way to edit /replace/override the vim.js file according to your commit, as linked? Then, I assume I should find a way to load this file from your commit?
I just meant that it isn’t possible right now and someone would need to implement it.
I see. Thanks for the clarification.