-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
y does not yank to clipboard #17
Comments
VSCode's API only allows copy selections to system clipboard now. Instead, I'd recommend you create a custom map to call the built-in copy command.
|
Is the selections blinking just a UI effect? Maybe we can get the VSCode guys to add a user setting to turn it off? |
Instead of turn the effect off, it would be better if they let extensions access system clipboard. |
Vim uses the If we support that, we'll need to have some notion of registers, which doesn't exist right now. |
Cross-referencing another clipboard issue: #166 |
I guess VS Code has this ability, since VSCodeVim has this option to use the system clipboard... Not sure exactly where it is in the codebase, but there are a few references that appear with a search: https://github.com/VSCodeVim/Vim/search?q=system+clipboard&unscoped_q=system+clipboard |
So I've found some keybindings that seem to work here! 🥳 // Yank (copy) to system clipboard in VISUAL and VISUAL_LINE modes
{
"key": "y",
"command": "editor.action.clipboardCopyAction",
"when": "editorTextFocus && amVim.mode == 'VISUAL' && !inDebugRepl &&!suggestWidgetMultipleSuggestions && !suggestWidgetVisible"
},
{
"key": "y",
"command": "editor.action.clipboardCopyAction",
"when": "editorTextFocus && amVim.mode == 'VISUAL LINE' && !inDebugRepl &&!suggestWidgetMultipleSuggestions && !suggestWidgetVisible"
},
{
"key": "y y",
"command": "editor.action.clipboardCopyAction",
"when": "editorTextFocus && amVim.mode == 'NORMAL' && !inDebugRepl &&!suggestWidgetMultipleSuggestions && !suggestWidgetVisible"
},
// Delete (cut) to system clipboard in VISUAL modes
{
"key": "d",
"command": "editor.action.clipboardCopyAction",
"when": "editorTextFocus && amVim.mode == 'VISUAL' && !inDebugRepl &&!suggestWidgetMultipleSuggestions && !suggestWidgetVisible"
}, Caveats
I'm also uncertain why I don't need to match for There is one more binding that I originally wrote to paste from system clipboard in // Paste from system clipboard only in NORMAL mode (not working - pastes also in INSERT mode)
{
"key": "p",
"command": "editor.action.clipboardPasteAction",
"when": "editorTextFocus && amVim.mode == 'NORMAL' && !inDebugRepl &&!suggestWidgetMultipleSuggestions && !suggestWidgetVisible"
}, @aioutecism can you comment on why the mode check is not working here? I tried looking through the code, but I'm really lost there... |
@aioutecism Also - would you consider adding this and an option for turning on this mode? I think there must be also a way to do it without the blinking (VSCodeVim achieves this somehow), but even with the blinking, it would be better than no copy to system clipboard (and also better than my hotkeys workaround). |
Asked in #166 (#166 (comment)) about having some instructions about how to add this feature (as well as paste from system clipboard): |
Answered #166 (comment) |
My first shot at a pull request up at #260. |
So now that we've got Ctrl+C, I need a way to copy+paste text between VS:C and other applications. Selection/highlighting only lets me copy 1 line (I'm not sure if this is amVim's fault or VS:C). Pressing y just yanks to some internal clipboard.
Normally in gvim, I would just use selection and middle-click to paste to other applications. Being able to yank to clipboard though would be very useful. I'm just not sure how possible or difficult that is with the underlying technologies.
The text was updated successfully, but these errors were encountered: