Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to replicate SublimeText ctrl+D in Visual Studio

I am used to work with Sublime text and trying to switch for Visual Studio for bigger projects, one of the feature of sublime that I absolutely love is its multiple select feature. You can hit ctrl + d multiple times to select next instance of the same word and then rewrite them all at once. Is there anything like this in Visual studio? I tryed to find it, but with no success.

Btw I am using Visual Studio 2015.

like image 363
Michael Očenášek Avatar asked Dec 14 '17 02:12

Michael Očenášek


People also ask

How do I add Ctrl D code to Visual Studio?

You can simply go to VSCode settings->Keybord Shortcuts and assign any keybinding to any command.

What does command d do in Visual Studio?

To solve this issue, we introduced Duplicate Code (Ctrl + D) in Visual Studio 2017 version 15.6 which streamlines the process of duplicating your code while leaving your clipboard untouched. If nothing is selected, Ctrl + D will duplicate the line the cursor is in and insert it right below the line in focus.


1 Answers

Visual studio 2017-19

The default shortcut is Alt+Shift+.


But if you want to add Ctrl+D

  • Go to the menu Tools > Options then select the Keyboard tab on the left

    At the top you'll find an option to add extra keybindings, select Visual Studio Code. Save and That's it! Setting

    This works because Visual Studio Code has Ctrl+D, and other shortcuts similar to SublimeText

Alternatively you can manually add shortcuts

In the image, you can find any command to customize in the middle section.

The particular command you are interested is the one selected Edit.InsertNextMatchingCaret

like image 76
Madacol Avatar answered Sep 20 '22 08:09

Madacol