CTRL+D is not working in vs code copy similar code

Viewed 2159

Previous in I have used ctr+d for duplicating the code many times, but when I switched to desktop and installed vs code and all the necessary extensions for my react project. And now this CTRL+D keyboard shortcut is not working. Can any help me to solve this issue

4 Answers

I recently met this issue too. I found a solution, see this: https://linuxpip.org/duplicate-lines-vscode/. The main step are:

  1. File > Preferences > Keyboard Shortcuts.
  2. type "copy line",then you will see the related shortcuts.
  3. remember the new shortcut(e.g. Shift + Alt + Down) or modify the shortcut to ctrl + D.

shift + alt + arrow-down works for me.

For me it was a VS Code extension causing the ctrl + ... binds not to work. It was "Vim emulation". Try isolating the issue by uninstalling the extensions until you find which one.

Similar issue for Windows 10, resolved using CTRL + F2.

Related