question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[vim] Ability to perform a copy

See original GitHub issue

Hi, I’m trying to use the vim mode from CodeMirror and there is one thing bordering me. I’m aware that the command Ctrl-C is used in vim to return to the normal mode, but in a GUI based text editor, Ctrl-C would pretty much always be the copy. I know that most people using vim would want to keep the Ctrl-C to change mode, but I think it could be an option. In the code the Ctrl-C is hardcoded (https://github.com/codemirror/CodeMirror/blob/f1692af532b78b7aeacb9dfc1962e2443866f65b/keymap/vim.js),

if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') {

Wouldn’t be nice to have an option to disable this? What to you think guys? I would be really interested to know your opinion.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:3
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
Mangecommented, Jan 25, 2018

I can’t even copy at all. I have to disable Vim mode, copy with CTRL-C and then enable vim mode again.

  • Ctrl-C exits insert mode.
  • Yanking only places text in the " register. Not possible to paste in other programs.
  • Cannot yank to + or * registers as they are not implemented.
  • X11 Primary selection does not work either.
  • No right-click menu to choose “Copy” from.
  • Ctrl-P still works to paste, however. Weird.

This is from using GraphQL Playground, which is using CodeMirror inside an Electron app, on Linux.

IMO yanking to + should perform a normal copy to the system clipboard, no matter what people think about the Ctrl-C situation. That could be a first step.

1reaction
mightyguavacommented, Feb 9, 2015

That sounds like a very reasonable suggestion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I copy text to the system clipboard from Vim?
+ uses CLIPBOARD; mnemonic: CTRL PLUS C (for the common keybind). On Windows & OS X there is no difference between + and...
Read more >
[vim] Ability to perform a copy · Issue #3075 - GitHub
Hi, I'm trying to use the vim mode from CodeMirror and there is one thing bordering me. I'm aware that the command Ctrl-C...
Read more >
How to copy to clipboard in Vim? - Stack Overflow
Copy the text [range] of vim into the system clipboard. (Hint: use v or V to select the range first, and then type...
Read more >
Copy and Paste in Vim - Tosbourn
Copy and Paste in Vim · Place the cursor on the line you want to begin cutting. · Press V to select the...
Read more >
Relative copy and paste in vim - P.T.C.
Relative copy and paste in vim · The colon ( : ) means that one is entering command-line mode. · The minus sign...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found