Vim: Ctrl+c in insert mode does not copy text, and unexpectedly switches to normal mode
Please thumbs-up 👍 this issue if it personally affects you! You can do this by clicking on the emoji-face on the top right of this post. Issues with more thumbs-up will be prioritized.
What did you do?
Ctrl+c in insert mode.
What did you expect to happen?
I expect normal VS Code features to work in insert mode, in this case for the selected text to be copied, and to remain in insert mode.
What happened instead?
Nothing was copied, normal mode was entered.
Technical details:
- VSCode Version: 1.10.2
- VsCodeVim Version: 0.6.11
- OS: Windows 10
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 60
- Comments: 15 (3 by maintainers)
I know this is a late reply, but if you to specifically only disable certain keys (in this case CTRL+C) from this extension, put the following in your settings.json:
If mac you can replace C(Ctrl) with D(command)
This is normal Vim behavior. If you want it turned off, you can set
vim.useCtrlKeysto false.Coming from Visual Studio and using the VsVim extension doesn’t require to go through hoops to use use Ctrl+C, X, V
This fixed it for me in settings.json:
For people like me that didn’t know where the settings.json file can be found, details here
I faced same issue
I SOLEVED IT BY
disabling vim extension in vscode
uninstaling vim extension
In
settings.jsonI have added:From the
readmeit says:Is it possible to disable
<C-c>in insertion mode only (i_CTRL-C), such that it still works in normal mode? For instance, it would copy in insertion mode and still abort a:commandin normal mode.The same problem.
For some reason setting this in
settings.json:"vim.useCtrlKeys": falsedoesn’t solve the problem.Ctrl+cstill activates the normal mode.I’ll just make this slightly more clear for anybody stopping by
By default, while in insert mode Vim uses the Ctrl+C command to switch to normal mode. But you may want to retain the original use of Ctrl+C (copying text). To do this you may have heard that you must set the
vim.useCtrlKeyssetting to false. But many of us have found that this still does not fix the problem! If that’s you, here’s how you solve it:What’s important to note is that you must set both the “Vim: Use Ctrl Keys” and the “Vim: Override Copy” settings to false. Just doing one or the other will not fix the problem
thanks. this solved my problem
@johnfn I tested this on the latest version of Vim, and it is not normal Vim behavior. You can use
Ctrl+c,Ctrl+v,Ctrl+z, to name a few in Vim in insert mode.