Visual Studio Code Ctrl D



This extension makes it possible to select multiple occurrences of a selected text for simultaneous editing with multiple cursors. Provides the most common multi-editing features.

Aims to replicate the multi-editing features of Sublime Text/Visual Studio Code for faster coding.

Visual Studio Code Ctrl D

What differs this from the built-in multi-edit of VS 2019?

FeatureSelect Next OccurrenceVisual Studio
Multiple cursorsYesYes
Can undo cursorYesYes
Can select all occurrencesYesYes
Can skip occurrenceYesYes
Can select backwards/upYesNo
Can add caret above/belowYesNo
Can add caret by mouseYesNo
Can convert selection to caretsYesNo
Can search both case insensitive and exactYesNo, only exact
Multi copy/paste across files and to external programsYesNo
Supports VS 2019YesYes
Supports VS 2017YesFrom v15.8
Supports VS 2015YesNo
Multi-cursor IntelliSenseNoNo

Features

  • Select next occurrence of current selection
  • Select next exact occurrence (overrides Find-dialog)
  • Select previous occurrence
  • Select previous exact occurrence (overrides Find-dialog)
  • Select all occurrences
  • Convert a selection into multiple cursors
  • Skip occurrence
  • Undo occurrence
  • Add caret above/below
  • Use multiple carets to edit
  • Add carets by mouse-clicking, press ALT and click to add a new caret or to remove caret/selection at clicked position
  • Copy/paste multiple selections, also to external programs


If you want to Move Last Selection To Next Find Match then use Ctrl + K + Ctrl + D. According to docs there's nothing keybinding by default to select previous occurrence. For advanced customization you can open and edit keybindings.json: And there you can assign keyboard shortcut to select previous occurrence: edited Jan 4 '18 at 13:17. Developer community 2. Search Search Microsoft.com. This Visual Studio extension adds a 'Duplicate Selection' command that you can bind to a keyboard shortcut of your choosing (but I recommend Ctrl+D). When invoked, the command inserts whatever text you have selected in front of the current selection. Alternatively, if you do not have a selection, it duplicates the line the caret is on. ⌘D (Windows, Linux Ctrl+D) selects the word at the cursor, or the next occurrence of the current selection. Tip: You can also add more cursors with ⇧⌘L (Windows, Linux Ctrl+Shift+L), which will add a selection at each occurrence of the current selected text. Multi-cursor modifier.

Options

  • Toggle case-sensitive search by using the 'Match case' setting from the find-dialog (Ctrl+F)
  • Toggle match-whole word search by using the 'Match whole word' setting from the find-dialog (Ctrl+F)
  • Options-dialog: Add cursors by mouse-clicking - true by default
  • Options-dialog: Keep caret on first entry - false by default, activates behaviour to keep caret on first entry when pressing escape


Key-bindings

Go to Tools -> Options -> Keyboard and search for these command names to edit at your choice. Make sure the Use new shortcut in is set to: Text Editor

Command (prefix SelectNextOccurrence.)Recommendation
SelectNextOccurrenceCtrl+D
SelectNextExactOccurrence
SelectPreviousOccurrenceCtrl+E
SelectPreviousExactOccurrence
SelectAllOccurrencesCtrl+K, Ctrl+A
SkipOccurrenceCtrl+K, Ctrl+D
UndoOccurrenceCtrl+U
AddCaretAboveCtrl+Alt+Up
AddCaretBelowCtrl+Alt+Down
ConvertSelectionToMultipleCursorsCtrl+Shift+I or Alt+Shift+I (vscode))


Troubleshooting

  • Nothing happens when pressing assigned keys

Check that the key-bindings are correct and that the Use new shortcut in is set to: Text Editor.

  • Nothing happens when ALT + left-clicking mouse button to add new caret, multiple edits are unresponsive

There is a possibility that other plugins use this functionality too, and a conflict occurs. Please check for other installed plugins with this feature and try to disable.

  • Copy/cut multiple occurrences doesnt work as expected

There is a conflict with the extension Copy As Html, if you have this enabled, try to disable it and see if this helps.


Donations

This is absolutely 100% free, a review or a Github star is much appreciated. If you still would like to support me for whatever reason, I'd accept a donation at https://www.paypal.me/thomaswelen

(Total amount donated up to 2021-04-04: $20)

Visual studio c++ example

Happy coding

All ReSharper actions can be invoked with keyboard shortcuts. Most of the actions have default shortcuts, which you can use out of the box. For the rest of the actions, you can assign a preferred shortcut keys if needed.

ReSharper provides two default keyboard shortcuts schemes.

  • Visual Studio— This scheme aims to minimize conflicts with Visual Studio's own keyboard shortcuts.

  • IntelliJ IDEA— This scheme shares the majority of shortcuts with those used in IntelliJ IDEA and its derivative web development IDEs. It provides a common keyboard-centric experience among all JetBrains development environments.

Whatever scheme you choose, you can always change individual keyboard shortcuts later.

You can also download ReSharper shortcuts as PDFs: Visual Studio scheme or IntelliJ IDEA scheme

If you want to change the shortcut for any single command, go to Tools | Options | Environment | Keyboard, find the command by its alias (see the right column in the tables below), press the new shortcut keys, and click Assign. For more information, see Configure Keyboard Shortcuts

Code Analysis

CommandShortcut
(Visual Studio)
Shortcut (IntelliJ IDEA/
ReSharper 2.x)
Alias
Toggle code analysis in the current fileCtrl+Alt+Shift+8Ctrl+Alt+Shift+8ReSharper_EnableDaemon
Next code issue (error, warning or suggestion) in fileAlt+PageDownF12ReSharper_GotoNextHighlight
Previous code issue (error, warning or suggestion) in fileAlt+PageUpShift+F12ReSharper_GotoPrevHighlight
Next error/warning in file/solutionAlt+Shift+PageDownAlt+F12ReSharper_GotoNextErrorInSolution
Previous error/warning in file/solutionAlt+Shift+PageUpShift+Alt+F12ReSharper_GotoPrevErrorInSolution
Inspect thisCtrl+Shift+Alt+ACtrl+Shift+Alt+AReSharper_InspectThis
View hierarchy of
types (C#, VB.NET, C++)
#include directives (C++)
styles (ASP.NET, Razor, CSS, XAML)
Ctrl+E HCtrl+Alt+HReSharper_TypeHierarchyBrowse
Inspection Results windowCtrl+Alt+VCtrl+Alt+,ReSharper_ShowInspectionWindow

Coding Assistance

CommandShortcut
(Visual Studio)
Shortcut (IntelliJ IDEA/
ReSharper 2.x)
Alias
Show action listAlt+EnterAlt+EnterReSharper_AltEnter
Paste from clipboard historyCtrl+Shift+VCtrl+Shift+VReSharper_PasteMultiple
Code cleanupCtrl+E CCtrl+Alt+FReSharper_CleanupCode
Silent code cleanupCtrl+E FCtrl+Shift+Alt+FReSharper_SilentCleanupCode
Reformat codeCtrl+Alt+EnterCtrl+Alt+LReSharper_ReformatCode
Apply Syntax StyleCtrl+Alt+SCtrl+Alt+SReSharper_ApplyCodeStyle
Basic code completionCtrl+SpaceCtrl+SpaceReSharper_CompleteCodeBasic
Smart code completionCtrl+Alt+SpaceCtrl+Shift+SpaceReSharper_CompleteCodeSmart
Import symbol completionAlt+Shift+SpaceCtrl+Alt+SpaceReSharper_CompleteCodeTypeName
Force completion for non-preselected itemCtrl+EnterCtrl+EnterReSharper_ForceCompleteItem
Complete statementCtrl+Shift+EnterCtrl+Shift+EnterReSharper_CompleteStatement
Parameter information: show/go to the next signatureOverrides Visual Studio command Edit.ParameterInfoCtrl+Shift+SpaceCtrl+PReSharper_ParameterInfoShow
Parameter information: go to the previous signatureCtrl+Alt+Shift+SpaceCtrl+Alt+Shift+SpaceReSharper_ParameterInfoGoToPreviousSignature
Toggle Inlay HintsCtrl+Alt+Shift+5Ctrl+Alt+Shift+5ReSharper_ToggleInlayHints
Quick documentationCtrl+Shift+F1Ctrl+QReSharper_QuickDoc
Insert live templateCtrl+E LCtrl+JReSharper_LiveTemplatesInsert
Surround with templateCtrl+E UAlt+Ctrl+JReSharper_SurroundWith
Create file from templateAlt+Ctrl+InsertAlt+Ctrl+InsertReSharper_GenerateFileBesides
Generate codeAlt+InsertAlt+InsertReSharper_Generate
Move code upCtrl+Shift+Alt+UpCtrl+Alt+Shift+UpReSharper_MoveUp
Move code downCtrl+Shift+Alt+DownCtrl+Alt+Shift+DownReSharper_MoveDown
Move code leftCtrl+Shift+Alt+LeftCtrl+Alt+Shift+LeftReSharper_MoveLeft
Move code rightCtrl+Shift+Alt+RightCtrl+Alt+Shift+RightReSharper_MoveRight
Extend selectionCtrl+Alt+RightCtrl+WReSharper_ExtendSelection
Shrink selectionCtrl+Alt+LeftCtrl+Shift+WReSharper_ShrinkSelection
Select containing declarationCtrl+Shift+[Ctrl+Shift+[ReSharper_SelectContainingDeclaration
Duplicate current line or selectionCtrl+DCtrl+DReSharper_DuplicateText
Join linesControl+Shift+JReSharper_JoinLines
Comment with line commentCtrl+Alt+/Ctrl+/ReSharper_LineComment
Comment with block commentCtrl+Shift+/Ctrl+Shift+/ReSharper_BlockComment
Run configurations pop-upCtrl+Shift+Alt+RCtrl+Shift+Alt+RReSharper_RunConfigSettings
Run with/without buildingCtrl+Alt+F5Ctrl+Alt+F5ReSharper_CurrentConfigRunAlt
Debug with/without buildingAlt+F5Alt+F5ReSharper_CurrentConfigDebugAlt

Navigation and Search

CommandShortcut
(Visual Studio)
Shortcut (IntelliJ IDEA/
ReSharper 2.x)
Alias
Search Everywhere/Go to TypeCtrl+TCtrl+NReSharper_GotoType
Go To FileCtrl+Shift+TShift+Ctrl+NReSharper_GotoFile
Go to file memberAlt+Ctrl+F12ReSharper_GotoFileMember
Go to symbolAlt+Shift+TShift+Ctrl+Alt+NReSharper_GotoSymbol
Go to textCtrl+T,T,TCtrl+N,N,NReSharper_GotoText
Navigate ToAlt+`Ctrl+Shift+GReSharper_NavigateTo
Go to type of symbolCtrl+Shift+F11Ctrl+Shift+TReSharper_GotoTypeDeclaration
Go to declarationOverrides Visual Studio command Edit.GotoDefinitionF12.Ctrl+BReSharper_GotoDeclaration
Go to implementationOverrides Visual Studio command Edit.GotoDeclarationCtrl+F12.Ctrl+Shift+Alt+BReSharper_GotoImplementations
Switch header/source (C++)Alt+OAlt+OReSharper_SwitchHeaderSource
Go to base symbolsAlt+HomeCtrl+UReSharper_GotoBase
Go to derived symbolsAlt+EndAlt+Ctrl+BReSharper_GotoInheritors
Go to usageShift+Alt+F12Ctrl+Alt+F7ReSharper_GotoUsage
Go to containing declarationCtrl+[Ctrl+[ReSharper_GotoContainingDeclaration
Go to next member/tagAlt+DownAlt+DownReSharper_GotoNextMember
Go to previous member/tagAlt+UpAlt+UpReSharper_GotoPrevMember
Structural navigation: forwardsTabTabReSharper_StructuralNavigationForward
Structural navigation: backwardsShift+TabShift+TabReSharper_StructuralNavigationBackward
Find usagesShift+F12Alt+F7ReSharper_FindUsages
Find usages of related entitiesCtrl+Shift+Alt+F12Shift+Alt+F7ReSharper_FindUsagesAdvanced
Highlight usages in fileShift+Alt+F11Ctrl+Shift+F7ReSharper_HighlightUsages
Go to previous location/highlightCtrl+Alt+PageUpCtrl+Alt+PageUpReSharper_ResultListGoToPrevLocation
Go to next location/highlightCtrl+Alt+PageDownCtrl+Alt+PageDownReSharper_ResultListGoToNextLocation
Remove highlighting of usagesEscEsc
View recent filesCtrl+,Ctrl+EReSharper_GotoRecentFiles
View recent editsCtrl+Shift+,Alt+Shift+Ctrl+BackspaceReSharper_GotoRecentEdits
Go to previous editShift+Ctrl+BackspaceShift+Ctrl+BackspaceReSharper_GotoLastEditLocation
Go to related filesCtrl+Alt+F7Ctrl+Alt+Shift+GReSharper_GotoRelatedFiles
Go to breakpointsCtrl+Alt+F9Ctrl+Alt+F9ReSharper_GotoBreakpoints
View bookmarksCtrl+`Ctrl+`ReSharper_BookmarksBookmarksMenu
Go to numbered bookmarkCtrl+[number]Ctrl+[number]ReSharper_BookmarksGoToBookmarkX
Toggle numbered bookmarkCtrl+Shift+[numeric key]Ctrl+Shift+[numeric key]ReSharper_BookmarksToggleBookmarkX
Find Results windowCtrl+Alt+F12Ctrl+Alt+UReSharper_ShowFindResults
File structureCtrl+Alt+FCtrl+F11ReSharper_ShowCodeStructure
To-do itemsCtrl+Alt+DCtrl+Alt+.ReSharper_ShowTodoExplorer
Stack Trace ExplorerCtrl+E TCtrl+Shift+EReSharper_ExploreStackTrace
Locate in Solution/Assembly ExplorerShift+Alt+LAlt+Shift+LReSharper_LocateInSolutionOrAssemblyExplorer
Optimize ReferencesCtrl+Alt+YCtrl+Alt+YReSharper_OptimizeReferences
Go to ActionCtrl+Shift+ACtrl+Shift+AReSharper_GotoAction

Refactorings

CommandShortcut
(Visual Studio)
Shortcut (IntelliJ IDEA/
ReSharper 2.x)
Alias
Refactor ThisCtrl+Shift+RCtrl+Shift+RReSharper_RefactorThis
RenameCtrl+R RF2ReSharper_Rename
MoveCtrl+R OF6ReSharper_Move
Safe deleteCtrl+R DAlt+DeleteReSharper_SafeDelete
Extract methodCtrl+R MCtrl+Alt+MReSharper_ExtractMethod
Introduce variableCtrl+R VCtrl+Alt+VReSharper_IntroVariable
Introduce fieldCtrl+R FCtrl+Alt+DReSharper_IntroduceField
Introduce parameterCtrl+R PCtrl+Alt+PReSharper_IntroduceParameter
InlineCtrl+R ICtrl+Alt+NReSharper_InlineVariable
Encapsulate fieldCtrl+R ECtrl+R EReSharper_EncapsulateField
Change signatureCtrl+R SCtrl+F6ReSharper_ChangeSignature

Visual Studio Code Ctrl + Click

Unit Testing

CommandShortcut
(Visual Studio)
Shortcut (IntelliJ IDEA/
ReSharper 2.x)
Alias
Run unit testsCtrl+U RCtrl+T RReSharper_UnitTestRunFromContext
Debug unit testsCtrl+U DCtrl+T DReSharper_UnitTestDebugContext
Run all tests in solutionCtrl+U LCtrl+T LReSharper_UnitTestRunSolution
Run current test sessionCtrl+U YCtrl+T YReSharper_UnitTestRunCurrentSession
Repeat previous test runCtrl+U UCtrl+T TReSharper_UnitTestSessionRepeatPreviousRun
Append to test sessionCtrl+U ACtrl+T AReSharper_UnitTestSessionAppendTests
Create new test sessionCtrl+U MCtrl+T MReSharper_ProfileAllTestsInCurrentContextWithMemoryUnit
Run tests under dotMemory UnitCtrl+U NCtrl+T NReSharper_UnitTestSessionNewSession
Unit Test ExplorerCtrl+Alt+UCtrl+Alt+TReSharper_ShowUnitTestExplorer
Unit Test SessionsCtrl+Alt+TCtrl+Alt+RReSharper_ShowUnitTestSessions

Tool Windows

Visual Studio Code Ctrl Download

CommandShortcut
(Visual Studio)
Shortcut (IntelliJ IDEA/
ReSharper 2.x)
Alias
File structureCtrl+Alt+FCtrl+F11ReSharper_ShowCodeStructure
Find Results windowCtrl+Alt+F12Ctrl+Alt+UReSharper_ShowFindResults
Hierarchies windowCtrl+E HCtrl+Alt+HReSharper_TypeHierarchyBrowse
Inspection Results windowCtrl+Alt+VCtrl+Alt+,ReSharper_ShowInspectionWindow
Stack Trace ExplorerCtrl+E TCtrl+Shift+EReSharper_ExploreStackTrace
To-do itemsCtrl+Alt+DCtrl+Alt+.ReSharper_ShowTodoExplorer
Unit Test ExplorerCtrl+Alt+UCtrl+Alt+TReSharper_ShowUnitTestExplorer
Unit Test SessionsCtrl+Alt+TCtrl+Alt+RReSharper_ShowUnitTestSessions
Close recent tool windowCtrl+Shift+F4Ctrl+Shift+F4ReSharper_WindowManagerCloseRecentTool
Activate recent tool windowCtrl+Alt+BackspaceCtrl+Alt+BackspaceReSharper_WindowManagerActivateRecentTool