Damien
Damien

Reputation: 2901

Visual Studio 2015 Ctrl + D (code duplication) not working (keyboard shortcut scheme issue with Resharper)

Ctrl + D in a Visual Studio 2015 Windows10 project is not working at all.. its working in Notepad++. I have tried to reboot my machine, and closed down Visual Studio but nothing works.

I have Windows 10 Threshold 2 and Visual Studio 2015 Version 14.0.23107.0

PS: it was working fine yesterday...

Edit1:

Keyboard mapping is looking good: enter image description here

Upvotes: 20

Views: 35259

Answers (6)

FernandoMartens
FernandoMartens

Reputation: 11

If you need to add the command in Visual Studio similar to Visual Studio Code, where pressing CTRL + D selects the next matching word, here’s the name of the command you need to configure:

Edit.InsertNextMatchingCaret.

Upvotes: 0

Developer Krish
Developer Krish

Reputation: 1

Goto File->Preferances->keybord Shortcut->On the top search duplicate->Double click on duplicate Selection->ctrl+Shift+D->Press Enter

Upvotes: 0

ankit
ankit

Reputation: 141

Below steps are worked for me.

  1. Go to Tools > Options >Environment >General> Keyboard
  2. Select visual C# 2005 in keyboard mapping scheme
  3. In Show commands containing, search for Edit.Duplicate
  4. Assign Ctrl + D in shortcut key

Upvotes: 9

postgresnewbie
postgresnewbie

Reputation: 1468

Just FYI, If you are VS 2019 User:

Extensions > Resharper > Options > Environment > Keyboard

Change Keyboard Scheme to None and save, then go back again and change it to Visual Studio

I was struggling with this problem for a while and this method fixed it.

Upvotes: 2

Michał Baranowski
Michał Baranowski

Reputation: 21

Reinstalling ReSharper fixed the issue for me

Upvotes: 2

Damien
Damien

Reputation: 2901

RESHARPER is/was the culprit

How to fix:

  • reset all Visual Studio settings (Tools > Import and Export Settings > Reset all settings)
  • then go to the Resharper > Options > Keyboard & Menus and re-apply the keyboard shortcut scheme.

and now its working again!

Upvotes: 60

Related Questions