Visual Studio Mac Duplicate Line



  1. Visual Studio Mac Python
  2. Visual Studio Mac Vs Windows

Visual Studio IDE Visual Studio for Mac Visual Studio Code. To continue downloading, click here. Visual Studio Codespaces 2021-03-19T12:32:41-07:00. GitHub Codespaces. Access cloud-hosted dev environments from Visual Studio Code or your browser. Learn more about GitHub Codespaces.

-->

You can navigate in Visual Studio more easily by using the shortcuts in this article. These shortcuts include keyboard and mouse shortcuts as well as text you can enter to help accomplish a task more easily.

For a complete list of command shortcuts, see Default keyboard shortcuts.

Note

  • If you want to easily duplicate a line of code in Visual Studio Code, you can do it with a simple keyboard shortcut. Just use the Copy Line Down ( Ctrl+Alt+UpArrow ) or Copy Line Up commands ( Ctrl+Alt+DownArrow ) — depending on where you want the new line inserted with respect to your cursor.
  • Visual Studio shortcut keys. A handy shortcut key reference to make your.NET lifestyle easier and more productive. The most important shortcuts are highlighted in red, like so: Shortcut.
  • Duplicate Line or Selection. Edit Duplicate Line or Selection Ctrl+D. One of the ways of creating a code element similar to an existing one (for example, a new method overload or a new auto-implemented property) is cloning the existing element with copy-paste and then editing the clone.
  • Using Microsofts Visual Studio Code, how do I duplicate a line of code and then move it up and down? (Similar to how Sublimes cmd+shift+d). It's a feature that I use constantly, and am struggling using Visual Studio Code without it.

This topic applies to Visual Studio on Windows. For Visual Studio for Mac, see Common keyboard shortcuts in Visual Studio for Mac.

Window management

TaskShortcut
Maximize floating windowDouble-click on title bar
Maximize/minimize windowsWin+Up arrow / Win+Down arrow
Redock floating windowCtrl+double-click on title bar
Move/dock floating windowsWin+Left arrow / Win+Right arrow
Close active documentCtrl+F4
Show open file listCtrl+Alt+Down arrow
Show all floating windowsCtrl+Shift+M
Show jump listWin+Alt+N
Start new instanceWin+Shift+N
Switch between windowsWin+N
Visual Studio Mac Duplicate Line

Search

TaskShortcut
Solution Explorer searchCtrl+;
Place focus in search box in any tool window (except editor)Alt+` when the tool window has focus
Search Visual StudioCtrl+Q
Search box results filter@opt - Options
@cmd - Commands
@mru - Most recently used
@doc - Open documents
Search in Tools OptionsCtrl+E
Duplicate

Find in the editor

TaskShortcut
Quick FindCtrl+F
Quick Find Next ResultEnter
Quick Find Previous ResultShift+Enter
Quick Find Expand Drop DownAlt+Down arrow
Dismiss FindEsc
Quick ReplaceCtrl+H
Quick Replace - Replace NextAlt+R
Quick Replace - Replace AllAlt+A
Find in FilesCtrl+Shift+F
Replace in FilesCtrl+Shift+H

Code editor

TaskShortcut
Go To AllCtrl+T
Go to recent filesCtrl+T,R
Multi-caret multiple insertion pointsCtrl+Alt+click
Multi-caret add matching selectionShift+Alt+Ins
Format DocumentCtrl+K,D
IntelliSense suggestion modeCtrl+Alt+Space (Toggle)
Force show IntelliSenseCtrl+J
Quick ActionsCtrl+.
Snippet pickerCtrl+K,X or ?,Tab (Visual Basic)
Surround WithCtrl+K,S
Show Quick InfoCtrl+K,I
Navigate ToCtrl+,
Navigate highlighted referencesCtrl+Shift+Up (Previous)
Ctrl+Shift+Down (Next)
Editor zoomCtrl+Shift+> (In)
Ctrl+Shift+< (Out)
Block selectionHold Alt and drag mouse
Shift+Alt+Arrow keys
Move line up/downAlt+Up arrow / Alt+Down arrow
Duplicate lineCtrl+E,V
Expand selectionShift+Alt+=
Contract selectionShift+Alt+-
Go To DefinitionF12
Peek DefinitionAlt+F12
Go To Definition stackCtrl+Shift+8 (Back)
Ctrl+Shift+7 (Forward)
Close the Peek Definition windowEsc
Promote the Peek Definition window to a regular document tabCtrl+Alt+Home
Navigate between multiple Peek Definition windowsCtrl+Alt+- and Ctrl+Alt+=
Navigate between multiple Peek resultsF8 and Shift+F8
Toggle between the code editor window and the Peek Definition windowShift+Esc
Go to enclosing blockCtrl+Alt+Up arrow
Go to next/previous issueAlt+PgUp / Alt+PgDn
Contextual navigation menuAlt+`

Toolbars

TaskShortcut
Add buttonsSelect the toolbar overflow button
Find combo in standard toolbarCtrl+D
Find textbox command modeType >
Create new aliasType alias <new alias> <command> in the Command window

Debugging

Microsoft visual studio mac
TaskShortcut
Start debuggingF5
Stop debuggingShift+F5
Restart debuggingCtrl+Shift+F5
Step overF10
Step intoF11
Step outShift+F11
Run to cursorCtrl+F10
Set next statementCtrl+Shift+F10
Set and toggle breakpointF9
Disable breakpointCtrl+F9
Immediate windowCtrl+Alt+I
Immediate window command modeType >
Immediate window - clear bufferType cls
Immediate window - print valueType ?varname

Visual Studio Mac Python

See also

Visual Studio Mac Vs Windows

ShortcutDescription
Ctrl-XorShift-DeleteCuts the currently selected item to the clipboard. Without selection it cuts the entire line to the clipboard.
Ctrl-CorCtrl-InsertCopies the currently selected item to the clipboard. Without selection it copies the entire line to the clipboard.
Ctrl-VorShift-InsertPastes the item in the clipboard at the cursor (with selection in clipboard), or at the next line (with line in clipboard).
Ctrl-ZorAlt-BackspaceUndo previous editing action
Ctrl-YorCtrl-Shift-ZRedo the previous undo action
Ctrl-Shift-VorCtrl-Shift-Insert Pastes an item from the clipboard ring tab of the Toolbox at the cursor in the file and automatically selects the pasted item. Cycle through the items on the clipboard by pressing the shortcut keys repeatedly
Ctrl + .orShift+Alt+F10 Opens smart tag and resolves a wide array of suggested code refactorings
Esc Closes a menu or dialog, cancels an operation in progress, or places focus in the current document window
Ctrl-S Saves the selected files in the current project (usually the file that is being edited)
Ctrl-Shift-SSaves all documents and projects
Ctrl-PDisplays the Print dialog
F7Switches from the design view to the code view in the editor
Shift-F7Switches from the code view to the design view in the editor
F8 Moves the cursor to the next item, for example in the TaskList window or Find Results window
Shift-F8Moves the cursor to the previous item, for example in the TaskList window or Find Results window
Shift-F12Finds a reference to the selected item or the item under the cursor
Ctrl-Shift-GOpens the file whose name is under the cursor or is currently selected
Ctrl-/Switches focus to the Find/Command box on the Standard toolbar
Ctrl-Shift-F12Moves to the next task in the TaskList window
Ctrl-Shift-8Moves backward in the browse history. Available in the object browser or Class View window
Alt-Left ArrowGo back in the web browser history
Alt-Right ArrowGo forward in the web browser history