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

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



Solution 1:[1]

shift + alt + arrow-down works for me.

Solution 2:[2]

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.

Solution 3:[3]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mustafa
Solution 2 carlo818
Solution 3 Wade Wang