Visual Studio Select Line


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.

When you install Visual Studio programmatically or from a command prompt, you can use a variety of command-line parameters to control or customize the installation to perform the following actions: Start the installation on the client with certain options and behaviors preselected. Adds the ability to expand selection to current line. Press F1 and narrow down the list commands by typing extension.Pick Extensions: Install Extension.Select the Select Line extension from the list. Developer community 2. Search Search If you want to select a line or lines you can use the combination of ctrl + E then U. This combination also works for uncommenting a complete line or lines. This combination looks somewhat strange to work with, but it will get habituated very soon:) You can also use Ctrl + X to cut an entire line. Filter line by input string. Open command palette (โ‡งโŒ˜p) and type filterline, select Filter Line By Input String in the list. Type a string and hit. The extension will output matching lines in a new file with postfix.filterline.$ (ext) (e.g. 1.log will generate file 1.log.filterline.log).

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


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

Window management

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


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

Find in the editor

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

Visual studio select line shortcut
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+`

Visual Studio Select Multiple Lines


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


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

See also


You can set and clear the Word wrap option. When this option is set, the portion of a long line that extends beyond the current width of the Code Editor window is displayed on the next line. When this option is cleared, for example, to facilitate the use of line numbering, you can scroll to the right to see the ends of long lines.


This topic applies to Visual Studio on Windows. For Visual Studio for Mac, see Source editor: Word wrap.

To set word wrap preferences

  1. On the Tools menu, select Options.

  2. In the Text Editor folder, choose the General options in the All Languages subfolder to set this option globally.

    โ€” or โ€”

    Choose the General options in the subfolder for the language in which you are programming.

  3. Under Settings, select or clear the Word wrap option.

    When the Word wrap option is selected, the Show visual glyphs for word wrap option is enabled.

  4. Select the Show visual glyphs for Word Wrap option if you prefer to display a return-arrow indicator where a long line wraps onto a second line. Clear this option if you prefer not to display indicator arrows.


    These reminder arrows are not added to your code; they are for display purposes only.

Known issues

If you're familiar with word wrap in Notepad++, Sublime Text, or Visual Studio Code, be aware of the following issues where Visual Studio behaves differently to other editors:

Visual Studio Multi Select Edit

Vscode select line

Visual Studio Select Line Shortcut

See also