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.
What differs this from the built-in multi-edit of VS 2019?
Feature | Select Next Occurrence | Visual Studio |
---|---|---|
Multiple cursors | Yes | Yes |
Can undo cursor | Yes | Yes |
Can select all occurrences | Yes | Yes |
Can skip occurrence | Yes | Yes |
Can select backwards/up | Yes | No |
Can add caret above/below | Yes | No |
Can add caret by mouse | Yes | No |
Can convert selection to carets | Yes | No |
Can search both case insensitive and exact | Yes | No, only exact |
Multi copy/paste across files and to external programs | Yes | No |
Supports VS 2019 | Yes | Yes |
Supports VS 2017 | Yes | From v15.8 |
Supports VS 2015 | Yes | No |
Multi-cursor IntelliSense | No | No |
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 |
---|---|
SelectNextOccurrence | Ctrl+D |
SelectNextExactOccurrence | |
SelectPreviousOccurrence | Ctrl+E |
SelectPreviousExactOccurrence | |
SelectAllOccurrences | Ctrl+K, Ctrl+A |
SkipOccurrence | Ctrl+K, Ctrl+D |
UndoOccurrence | Ctrl+U |
AddCaretAbove | Ctrl+Alt+Up |
AddCaretBelow | Ctrl+Alt+Down |
ConvertSelectionToMultipleCursors | Ctrl+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)
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
Command | Shortcut (Visual Studio) | Shortcut (IntelliJ IDEA/ ReSharper 2.x) | Alias |
---|---|---|---|
Toggle code analysis in the current file | Ctrl+Alt+Shift+8 | Ctrl+Alt+Shift+8 | ReSharper_EnableDaemon |
Next code issue (error, warning or suggestion) in file | Alt+PageDown | F12 | ReSharper_GotoNextHighlight |
Previous code issue (error, warning or suggestion) in file | Alt+PageUp | Shift+F12 | ReSharper_GotoPrevHighlight |
Next error/warning in file/solution | Alt+Shift+PageDown | Alt+F12 | ReSharper_GotoNextErrorInSolution |
Previous error/warning in file/solution | Alt+Shift+PageUp | Shift+Alt+F12 | ReSharper_GotoPrevErrorInSolution |
Inspect this | Ctrl+Shift+Alt+A | Ctrl+Shift+Alt+A | ReSharper_InspectThis |
View hierarchy of types (C#, VB.NET, C++) #include directives (C++) styles (ASP.NET, Razor, CSS, XAML) | Ctrl+E H | Ctrl+Alt+H | ReSharper_TypeHierarchyBrowse |
Inspection Results window | Ctrl+Alt+V | Ctrl+Alt+, | ReSharper_ShowInspectionWindow |
Coding Assistance
Command | Shortcut (Visual Studio) | Shortcut (IntelliJ IDEA/ ReSharper 2.x) | Alias |
---|---|---|---|
Show action list | Alt+Enter | Alt+Enter | ReSharper_AltEnter |
Paste from clipboard history | Ctrl+Shift+V | Ctrl+Shift+V | ReSharper_PasteMultiple |
Code cleanup | Ctrl+E C | Ctrl+Alt+F | ReSharper_CleanupCode |
Silent code cleanup | Ctrl+E F | Ctrl+Shift+Alt+F | ReSharper_SilentCleanupCode |
Reformat code | Ctrl+Alt+Enter | Ctrl+Alt+L | ReSharper_ReformatCode |
Apply Syntax Style | Ctrl+Alt+S | Ctrl+Alt+S | ReSharper_ApplyCodeStyle |
Basic code completion | Ctrl+Space | Ctrl+Space | ReSharper_CompleteCodeBasic |
Smart code completion | Ctrl+Alt+Space | Ctrl+Shift+Space | ReSharper_CompleteCodeSmart |
Import symbol completion | Alt+Shift+Space | Ctrl+Alt+Space | ReSharper_CompleteCodeTypeName |
Force completion for non-preselected item | Ctrl+Enter | Ctrl+Enter | ReSharper_ForceCompleteItem |
Complete statement | Ctrl+Shift+Enter | Ctrl+Shift+Enter | ReSharper_CompleteStatement |
Parameter information: show/go to the next signature | Overrides Visual Studio command Edit.ParameterInfo Ctrl+Shift+Space | Ctrl+P | ReSharper_ParameterInfoShow |
Parameter information: go to the previous signature | Ctrl+Alt+Shift+Space | Ctrl+Alt+Shift+Space | ReSharper_ParameterInfoGoToPreviousSignature |
Toggle Inlay Hints | Ctrl+Alt+Shift+5 | Ctrl+Alt+Shift+5 | ReSharper_ToggleInlayHints |
Quick documentation | Ctrl+Shift+F1 | Ctrl+Q | ReSharper_QuickDoc |
Insert live template | Ctrl+E L | Ctrl+J | ReSharper_LiveTemplatesInsert |
Surround with template | Ctrl+E U | Alt+Ctrl+J | ReSharper_SurroundWith |
Create file from template | Alt+Ctrl+Insert | Alt+Ctrl+Insert | ReSharper_GenerateFileBesides |
Generate code | Alt+Insert | Alt+Insert | ReSharper_Generate |
Move code up | Ctrl+Shift+Alt+Up | Ctrl+Alt+Shift+Up | ReSharper_MoveUp |
Move code down | Ctrl+Shift+Alt+Down | Ctrl+Alt+Shift+Down | ReSharper_MoveDown |
Move code left | Ctrl+Shift+Alt+Left | Ctrl+Alt+Shift+Left | ReSharper_MoveLeft |
Move code right | Ctrl+Shift+Alt+Right | Ctrl+Alt+Shift+Right | ReSharper_MoveRight |
Extend selection | Ctrl+Alt+Right | Ctrl+W | ReSharper_ExtendSelection |
Shrink selection | Ctrl+Alt+Left | Ctrl+Shift+W | ReSharper_ShrinkSelection |
Select containing declaration | Ctrl+Shift+[ | Ctrl+Shift+[ | ReSharper_SelectContainingDeclaration |
Duplicate current line or selection | Ctrl+D | Ctrl+D | ReSharper_DuplicateText |
Join lines | Control+Shift+J | ReSharper_JoinLines | |
Comment with line comment | Ctrl+Alt+/ | Ctrl+/ | ReSharper_LineComment |
Comment with block comment | Ctrl+Shift+/ | Ctrl+Shift+/ | ReSharper_BlockComment |
Run configurations pop-up | Ctrl+Shift+Alt+R | Ctrl+Shift+Alt+R | ReSharper_RunConfigSettings |
Run with/without building | Ctrl+Alt+F5 | Ctrl+Alt+F5 | ReSharper_CurrentConfigRunAlt |
Debug with/without building | Alt+F5 | Alt+F5 | ReSharper_CurrentConfigDebugAlt |
Navigation and Search
Command | Shortcut (Visual Studio) | Shortcut (IntelliJ IDEA/ ReSharper 2.x) | Alias |
---|---|---|---|
Search Everywhere/Go to Type | Ctrl+T | Ctrl+N | ReSharper_GotoType |
Go To File | Ctrl+Shift+T | Shift+Ctrl+N | ReSharper_GotoFile |
Go to file member | Alt+ | Ctrl+F12 | ReSharper_GotoFileMember |
Go to symbol | Alt+Shift+T | Shift+Ctrl+Alt+N | ReSharper_GotoSymbol |
Go to text | Ctrl+T,T,T | Ctrl+N,N,N | ReSharper_GotoText |
Navigate To | Alt+` | Ctrl+Shift+G | ReSharper_NavigateTo |
Go to type of symbol | Ctrl+Shift+F11 | Ctrl+Shift+T | ReSharper_GotoTypeDeclaration |
Go to declaration | Overrides Visual Studio command Edit.GotoDefinition F12. | Ctrl+B | ReSharper_GotoDeclaration |
Go to implementation | Overrides Visual Studio command Edit.GotoDeclaration Ctrl+F12. | Ctrl+Shift+Alt+B | ReSharper_GotoImplementations |
Switch header/source (C++) | Alt+O | Alt+O | ReSharper_SwitchHeaderSource |
Go to base symbols | Alt+Home | Ctrl+U | ReSharper_GotoBase |
Go to derived symbols | Alt+End | Alt+Ctrl+B | ReSharper_GotoInheritors |
Go to usage | Shift+Alt+F12 | Ctrl+Alt+F7 | ReSharper_GotoUsage |
Go to containing declaration | Ctrl+[ | Ctrl+[ | ReSharper_GotoContainingDeclaration |
Go to next member/tag | Alt+Down | Alt+Down | ReSharper_GotoNextMember |
Go to previous member/tag | Alt+Up | Alt+Up | ReSharper_GotoPrevMember |
Structural navigation: forwards | Tab | Tab | ReSharper_StructuralNavigationForward |
Structural navigation: backwards | Shift+Tab | Shift+Tab | ReSharper_StructuralNavigationBackward |
Find usages | Shift+F12 | Alt+F7 | ReSharper_FindUsages |
Find usages of related entities | Ctrl+Shift+Alt+F12 | Shift+Alt+F7 | ReSharper_FindUsagesAdvanced |
Highlight usages in file | Shift+Alt+F11 | Ctrl+Shift+F7 | ReSharper_HighlightUsages |
Go to previous location/highlight | Ctrl+Alt+PageUp | Ctrl+Alt+PageUp | ReSharper_ResultListGoToPrevLocation |
Go to next location/highlight | Ctrl+Alt+PageDown | Ctrl+Alt+PageDown | ReSharper_ResultListGoToNextLocation |
Remove highlighting of usages | Esc | Esc | |
View recent files | Ctrl+, | Ctrl+E | ReSharper_GotoRecentFiles |
View recent edits | Ctrl+Shift+, | Alt+Shift+Ctrl+Backspace | ReSharper_GotoRecentEdits |
Go to previous edit | Shift+Ctrl+Backspace | Shift+Ctrl+Backspace | ReSharper_GotoLastEditLocation |
Go to related files | Ctrl+Alt+F7 | Ctrl+Alt+Shift+G | ReSharper_GotoRelatedFiles |
Go to breakpoints | Ctrl+Alt+F9 | Ctrl+Alt+F9 | ReSharper_GotoBreakpoints |
View bookmarks | Ctrl+` | Ctrl+` | ReSharper_BookmarksBookmarksMenu |
Go to numbered bookmark | Ctrl+[number] | Ctrl+[number] | ReSharper_BookmarksGoToBookmarkX |
Toggle numbered bookmark | Ctrl+Shift+[numeric key] | Ctrl+Shift+[numeric key] | ReSharper_BookmarksToggleBookmarkX |
Find Results window | Ctrl+Alt+F12 | Ctrl+Alt+U | ReSharper_ShowFindResults |
File structure | Ctrl+Alt+F | Ctrl+F11 | ReSharper_ShowCodeStructure |
To-do items | Ctrl+Alt+D | Ctrl+Alt+. | ReSharper_ShowTodoExplorer |
Stack Trace Explorer | Ctrl+E T | Ctrl+Shift+E | ReSharper_ExploreStackTrace |
Locate in Solution/Assembly Explorer | Shift+Alt+L | Alt+Shift+L | ReSharper_LocateInSolutionOrAssemblyExplorer |
Optimize References | Ctrl+Alt+Y | Ctrl+Alt+Y | ReSharper_OptimizeReferences |
Go to Action | Ctrl+Shift+A | Ctrl+Shift+A | ReSharper_GotoAction |
Refactorings
Command | Shortcut (Visual Studio) | Shortcut (IntelliJ IDEA/ ReSharper 2.x) | Alias |
---|---|---|---|
Refactor This | Ctrl+Shift+R | Ctrl+Shift+R | ReSharper_RefactorThis |
Rename | Ctrl+R R | F2 | ReSharper_Rename |
Move | Ctrl+R O | F6 | ReSharper_Move |
Safe delete | Ctrl+R D | Alt+Delete | ReSharper_SafeDelete |
Extract method | Ctrl+R M | Ctrl+Alt+M | ReSharper_ExtractMethod |
Introduce variable | Ctrl+R V | Ctrl+Alt+V | ReSharper_IntroVariable |
Introduce field | Ctrl+R F | Ctrl+Alt+D | ReSharper_IntroduceField |
Introduce parameter | Ctrl+R P | Ctrl+Alt+P | ReSharper_IntroduceParameter |
Inline | Ctrl+R I | Ctrl+Alt+N | ReSharper_InlineVariable |
Encapsulate field | Ctrl+R E | Ctrl+R E | ReSharper_EncapsulateField |
Change signature | Ctrl+R S | Ctrl+F6 | ReSharper_ChangeSignature |
Visual Studio Code Ctrl + Click
Unit Testing
Command | Shortcut (Visual Studio) | Shortcut (IntelliJ IDEA/ ReSharper 2.x) | Alias |
---|---|---|---|
Run unit tests | Ctrl+U R | Ctrl+T R | ReSharper_UnitTestRunFromContext |
Debug unit tests | Ctrl+U D | Ctrl+T D | ReSharper_UnitTestDebugContext |
Run all tests in solution | Ctrl+U L | Ctrl+T L | ReSharper_UnitTestRunSolution |
Run current test session | Ctrl+U Y | Ctrl+T Y | ReSharper_UnitTestRunCurrentSession |
Repeat previous test run | Ctrl+U U | Ctrl+T T | ReSharper_UnitTestSessionRepeatPreviousRun |
Append to test session | Ctrl+U A | Ctrl+T A | ReSharper_UnitTestSessionAppendTests |
Create new test session | Ctrl+U M | Ctrl+T M | ReSharper_ProfileAllTestsInCurrentContextWithMemoryUnit |
Run tests under dotMemory Unit | Ctrl+U N | Ctrl+T N | ReSharper_UnitTestSessionNewSession |
Unit Test Explorer | Ctrl+Alt+U | Ctrl+Alt+T | ReSharper_ShowUnitTestExplorer |
Unit Test Sessions | Ctrl+Alt+T | Ctrl+Alt+R | ReSharper_ShowUnitTestSessions |
Tool Windows
Visual Studio Code Ctrl Download
Command | Shortcut (Visual Studio) | Shortcut (IntelliJ IDEA/ ReSharper 2.x) | Alias |
---|---|---|---|
File structure | Ctrl+Alt+F | Ctrl+F11 | ReSharper_ShowCodeStructure |
Find Results window | Ctrl+Alt+F12 | Ctrl+Alt+U | ReSharper_ShowFindResults |
Hierarchies window | Ctrl+E H | Ctrl+Alt+H | ReSharper_TypeHierarchyBrowse |
Inspection Results window | Ctrl+Alt+V | Ctrl+Alt+, | ReSharper_ShowInspectionWindow |
Stack Trace Explorer | Ctrl+E T | Ctrl+Shift+E | ReSharper_ExploreStackTrace |
To-do items | Ctrl+Alt+D | Ctrl+Alt+. | ReSharper_ShowTodoExplorer |
Unit Test Explorer | Ctrl+Alt+U | Ctrl+Alt+T | ReSharper_ShowUnitTestExplorer |
Unit Test Sessions | Ctrl+Alt+T | Ctrl+Alt+R | ReSharper_ShowUnitTestSessions |
Close recent tool window | Ctrl+Shift+F4 | Ctrl+Shift+F4 | ReSharper_WindowManagerCloseRecentTool |
Activate recent tool window | Ctrl+Alt+Backspace | Ctrl+Alt+Backspace | ReSharper_WindowManagerActivateRecentTool |