87

In Visual Studio Code Ctrl+V is not working on editor.

However from the command palette Ctrl+Shift+V is working.

5
  • 4
    Look up what Ctrl+V is bound to in the keyboard shortcuts. [Gear icon/Keyboard shortcuts] - search for "ctrl+V" anything there that would conflict with paste?
    – Mark
    Commented Jul 25, 2018 at 14:13
  • @Mark you are right there was a conflict issue, you can put in answer if you want to so i can select it Commented Jul 25, 2018 at 17:31
  • 1
    Ensure that an added extension is not the root cause. Disable them all, then turn one at a time back on. Good luck!
    – Porky
    Commented Jun 18, 2020 at 16:05
  • 1
    This bit me hard with Jupyter notebooks in vsCode - paste is remapped, it seems!
    – ptim
    Commented Jun 25, 2020 at 8:16
  • 1
    in my VSCode settings is fine. ctrl+a and ctrl+z is working, but ctrl+c and ctrl+v is wrong. rebooting VSCode is helped me.
    – romanown
    Commented Mar 1, 2021 at 6:40

32 Answers 32

56

I´ve had this problem when I enabled the "VIM" plugin for VSCode.

After uninstalling it, the problem was fixed.

7
  • 6
    Thanks, this was the culprit for me too. When I disabled the plugin, reloaded VS Code, re-enabled VIM the problem was gone though.
    – Thor Galle
    Commented May 20, 2019 at 6:48
  • 2
    In my case, I had "Clipboard History" installed. Disabling that seemed to work. Commented Sep 23, 2019 at 15:52
  • 1
    Yeah same here. Vim was the problem.
    – Ender
    Commented Jan 5, 2022 at 18:36
  • Thanks - I had the exact same caused by VIM plugin!
    – Dave Hogan
    Commented Nov 29, 2022 at 15:44
  • Ya except I cannot live without Vim... I wish there was a Vim plugin for everything that has a text editor
    – Gerry
    Commented Apr 15, 2023 at 15:23
53

Open the keyboard shortcuts preferences by pressing CTRL + SHIFT + P and search for open keyboard shortcuts file.

Then, search for the editor.action.clipboardPasteAction property. In your case, it might be CTRL+SHIFT+V. Try changing it to Ctrl + V. Like so:

enter image description here

Solution as of 2022

You could also CTRL + SHIFT + P and search for open keyboard shortcuts (JSON) and paste the following:

// Place your key bindings in this file to override the defaults
[
  {
    "key": "ctrl+v",
    "command": "-workbench.action.terminal.sendSequence",
    "when": "terminalFocus && !accessibilityModeEnabled && terminalShellType == 'pwsh'"
  },
  {
    "key": "ctrl+k",
    "command": "workbench.action.terminal.clear"
  }
]
6
  • 3
    I open keybord shortcut file and find "editor.action.clipboardPasteAction" there is Ctrl+V, Commented Jul 25, 2018 at 17:28
  • 3
    Do you have another action for ctrl+v in the file?
    – WebD
    Commented Jul 25, 2018 at 17:30
  • 2
    Yes there was a conflict issue Commented Jul 25, 2018 at 17:32
  • 3
    +1 Just as a for instance of what such a conflict could look like, I have the VIm emulation plugin installed, and extension.vim_cmd+v had grabbed control of paste in ways I don't think it intended to. Swapped the shortcut for that command to ctrl-option-command-v in Keyboard Shortcuts (not the json version) and things are happy again.
    – ruffin
    Commented Apr 7, 2020 at 16:37
  • 1
    If you want Ctrl+V to paste in a VS Code terminal as well open your keyboard shortcuts and find workbench.action.terminal.paste and replace it with Ctrl+V. Commented Apr 2, 2021 at 16:42
20

@WebD'is answer is very helpful and I have upvoted it. But my comment focused on whether there was a conflicting binding for CTRL-V and how to find it. You can literally type "Ctrl+V" (note the "plus+" sign, not a hyphen) and it will find all keybindings that use that binding in whole or part. I suggest that there must be a something else also bound to CTRL-V.


Since this original answer, vscode introduced another way to see what other commands might be bound to given keystrokes. With the Gear/Keyboard Shortcuts file open click on the little keyboardy icon to the right (or Alt+K with this file open) and it will indicate Recording Keys next to it. Now you can literally press Ctrl+V (or whichever keybinding you are interested in) and those corresponding commands, if any, that use that keybinding will be filtered up.

Remember to disable the Recording Keys functionality by clicking the keyboardy icon if you want to go back to regular searching in the Keyboard Shortcuts file.

1
  • Pressing "CTRL+V" is a great idea. It showed me that with the PowerShell extension installed, an entry is present ("terminalFocus && !accessibilityModeEnabled && terminalShellType == 'pwsh'") that will hijack that keyboard combination.
    – Zian Choy
    Commented Oct 19, 2022 at 18:34
16

If you install the vim extension for visual studio code and find that ctrl + x, ctrl + v .. or other shortcuts stopped working, this is because they are overwritten by extension.vim_

If you prefer to get those shortcuts back go to keyboard shortcuts (ctrl + shift + p, then search for open keyboard shortcuts file).

  • Search for extension.vim_ and check too see if any shortcuts are assigned to your key combination like ctrl + v. Remove it (right click, delete).
  • Also check for any other conflict by searching the file.
  • Save the file, it should work now.

vim keyboard extensions

3
  • 1
    Thanks. On my mac removing extension.vim_cmd+v enabled pasting in insert mode, and following @unstable's advice to set vim.useSystemClipboard to true enabled pasting in normal mode with p.
    – apostl3pol
    Commented Aug 25, 2020 at 22:24
  • This was the problem for me, but with AmVim. Strangely, although it had entries for Ctrl+c and Ctrl+v, only Copy wasn't working. Paste was fine. But deleting the AmVim Ctrl+C entry got back my shortcut. Commented Mar 17, 2021 at 17:26
  • 1
    For me I had to open settings.json and add "vim.useCtrlKeys": false to the file and then all ctrl shortcuts worked again. Commented Jan 24, 2022 at 4:19
15

I have the same problem: can't CTRL+X, CTRL+C, CTRL+V on VSCode editor. I uninstall the Vim extension and the problem is fixed.

enter image description here

1
  • This is not a solution, copy/paste need to work WITH vim
    – Gerry
    Commented Apr 15, 2023 at 15:25
12

For future searchers who do not have Vim (or any other extension) installed which is causing the issue, and who might have verified that their keyboard bindings are correct....

I have the Salesforce Extension Pack installed and had right-clicked on a file and run SFDX: Deploy Source to Org. The deployment had errors, so in the Panel area (which I have at the bottom of my screen) [see image] I had clicked on both the OUTPUT and PROBLEMS tabs, which shifted focus away from my PowerShell TERMINAL tab.

My Ctrl-V issue was when I was trying to correct my Apex code in the EDITOR pane. Ctrl-V was not pasting the code I had just Cut or Copied (but right-clicking and choosing Paste was working).

I ultimately discovered, when I changed my Panel focus back to my PowerShell TERMINAL tab, that ALL of the Ctrl-V pasting I had attempted had shown up after my PowerShell prompt! ["circled" in blue in image]


tl;dr

Make sure your pasted text did not show up in your TERMINAL - even if it is not in focus or even if your cursor is in another Panel tab or in the EDITOR.

Screenshot of portions of VS Code with EDITOR and PANEL labelled; Problems, Output and Terminal circled in orange, and the pasted text at the Terminal prompt outlined in blue.

2
  • 2
    I can confirm that the "TERMINAL" window is the issue. For me, it wasn't even pasting it there. After I interrupted the terminal, the Ctrl + V worked fine. This is definitely a bug.
    – Johnny
    Commented Apr 20, 2021 at 12:23
  • 2
    No vim, no salesforce extension pack, very common extensions working in c# I'm not sure how it resolved but opening the terminal attempt to paste, nothing, click on the clear button to clear the terminal and it switched to a Powershell window with a blinking cursor and I could suddenly paste anywhere again with ctrl-v. It's a bug of some kind.
    – JohnC
    Commented Apr 29, 2021 at 13:47
7

From File > Performance > Keyboard Shortcuts > search paste > just try to remove or rest some keybinding with right click on paste or default:paste

enter image description here

1
  • 1
    I removed the editor.action.clipboardPasteAction keybinding. Not entirely sure what that command does anyway as it works without it. It'd be great to know what the difference is between default:paste, paste, editor.action.clipboardPasteAction and execPaste, as paste works without any of those keybindings.
    – Studocwho
    Commented Sep 16, 2022 at 1:02
7

This problem happened to me after I left VSC update itself (currently 1.53.0). It had been converted to Shift-Insert.

Go to File->Preferences->Keyboard shortcuts. Find the editor.action.clipboardPasteAction and double click it, then type Ctrl+V.

1
  • 1
    Same here (current v1.55)
    – Jono
    Commented Apr 28, 2021 at 23:34
6

If you have the Vim extension installed, you may set the vim.useSystemClipboard in the vim extension setting to true. Then you can paste the content from the clipboard by simply pressing p in the NORMAL mode, or use Ctrl+V in the INSERT mode.

4

+1 for this - in case this helps anyone:

In my case it was only happening in the Thunder Client extension's text fields.

The culprit for me was the Indent on Paste extension (I'm on a Mac, so it was cmd+v instead of ctrl+v - but it fires the same event in VS Code).

I've left issue comments on the Thunder Client and Indent on Paste repos respectively, should anyone wish to add to those.

1
  • 1
    I am on Mac too and I found this helpful. disabling the Indent on Paste for Visual Studio Code solved it for me at the time when I had a similar issue. Also, @webD answer is helpful too Commented Jul 10, 2021 at 5:43
4

Look if and remove any VS Code extension : for example - "Awesome Emacs Keymap" in my case, or any other keymaps installed.

i.e. : FILE/Preferences>/extensions and then look if any special keymap was installed

enter image description here

1
3

Modify the setting of vscode: Settings - input:vim ctrl key - unselect: Enale some vim ctrl key commands that override otherwise common operations, like ctrl + c

3

go to extensions search Emacs keymap and uninstall it

0
3

There should something conflicting to your any previous keyboard shortcut like in my case for Change All Occurrence: (Ctrl-C + Ctrl-A), vs code, confused with Ctrl-C for a copy shortcut to this : (Ctrl-C + Ctrl-A), so I change this to (Shift-C + Shift-A), My Issue resolved.

3

Go to File>Preference>keyboard Shortcuts Then Check for Copy and paste and enter the Ctrl+C and Ctrl+v shortcuts

Happy Coding ;)

3

None of the issues above solved this for me. I had a key binding Ctrl+C Ctrl+L. So when I pressed Ctrl+C it was in a state where it was waiting for the next key to be pressed and wouldn't do anything.

This showed up in the toolbar like so (an example):

enter image description here

This didn't come up in the list of keybindings when searching for Ctrl+C. So I found it be looking through the list.

3

Remove all cmd+v or in windows ctrl+v associated keybindings.

0
3

For me the solution was going through my extensions and disabling them one by one to find the culprit.

I had 'Paste and Indent' enabled which was messing up copying and pasting.

Just had to disable it and reload vs code.

3

Open Settings > keyboard shortcuts

Search for Ctrl + c

Delete the mapping for vim.

2

i have same problem step:1

ctrl+shift+p

step:2 find

Open keyboard shortcuts

step:3

find paste

then you can see

editor.action.cliboardPasteAction 
  1. right click then changekeybinding if key wrong

  2. or remove key if u found two same line(editor.action.cliboardPasteAction)

in my case is 2nd one(so i removed)

2

In my case just the relaunch of VSCode solved the issue. My key bindings were fine.

2

In some cases, if you use remote ssh connects to a remote server and code there, ctrl + V may not be useful because that your remote server has a high balance, you can try to uninstall some useless plugins in that remote server then reload vscode.

2

"Paste JSON as Code" was my offender, as well as a few other ones. I got a little extension happy there for a bit. enter image description here

1
  • This isue may also be caused by the WSL pluggin. However only for the terminal. Visual Studio Code will automatically ask you to install the WSL plugging if it detects that you have WSL installed on your machine. However it will also change the console to accept left click to paste. It should still support CTRL + V. In my case it somehow forgot to do this. Disabeling/Enabling resolved this! Commented Mar 12 at 16:17
2

I have disabled all extensions, and VS Code hangs for a few seconds whenever I try to paste something. This occurs with Ctrl+V, Shift+Ins and also with right click + Paste.

It hangs, and then nothing happens.

[UPDATE] I simply reinstalled it, and that solved the issue for me.

1
2

Its easy don't worry, you need to search using ctrl+shift+p and find Prefernces: Open Keyboard Shortcuts(JSON) and add this dict

// Place your key bindings in this file to override the defaults
[
    {
        "key": "ctrl+c",
        "command": "editor.action.clipboardCopyAction",
        "when": "textInputFocus"
    }
]

enter image description here

I thins it's very helpfull good luck :)

2

If you did everything above, but you still cannot use ctrl+c, ctrl+v to copy paste in terminal, this is the fix:

ctrl + shift + p, then search for settings.json, and click Open User Settings (JSON):

make sure you have this line in it:

{
...
"terminal.integrated.sendKeybindingsToShell": false,
...
}

Then, ctrl + shift + p, then search for keyboard shortcuts, and click Open Keyboard Shortcuts (JSON):

Delete everything, and paste this in it:

// Place your key bindings in this file to override the defaultsauto[]
[
    {
        "key": "ctrl+v",
        "command": "workbench.action.terminal.paste",
        "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
    },
    {
        "key": "ctrl+shift+v",
        "command": "-workbench.action.terminal.paste",
        "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
    },
    {
        "key": "ctrl+c",
        "command": "workbench.action.terminal.copySelection",
        "when": "terminalFocus && terminalHasBeenCreated && terminalTextSelected || terminalFocus && terminalProcessSupported && terminalTextSelected"
    },
    {
        "key": "ctrl+shift+c",
        "command": "-workbench.action.terminal.copySelection",
        "when": "terminalFocus && terminalHasBeenCreated && terminalTextSelected || terminalFocus && terminalProcessSupported && terminalTextSelected"
    }
]
1

In my case everything was solved changing into Ctrl + v here:

workbench.action.terminal.paste:

workbench.action.terminal.paste

1
  • Could you maybe show why you did the action to help the person asking the question to be able to know how to do something similar and add more settings? Commented Apr 3, 2023 at 17:41
0

**For 2023 coders : **.
If your shortcut keys such as Ctrl+C & Ctrl+V not working ( neither in code file nor in Terminal ), no need to worry 😄

Try : Ctrl+insert (for copy) , Shift+insert (for paste )

1
  • Insert is much, MUCH harder to reach then V. Not really a solution.
    – Bowis
    Commented Sep 12, 2023 at 14:38
0

In my case it was not taking the latest text copied in clipboard,

I have removed the key bindings of copy and paste associated (insert binding) was there except the ctrl + c & ctrl + v and restarted the vs code editor

keybindings (windows) -> ctrl + shift + p -> keyboard shortcuts

0

The issue for me was the extension "Eclipse Win Keymap". I uninstalled and made sure I have only the "Eclipse Keymap" and it is back to normal now.

Not the answer you're looking for? Browse other questions tagged or ask your own question.