Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any shortcut to select the current line in Visual Studio?

I couldn't find such feature in VS's shortcut list. Is there anyway?

like image 748
demaxSH Avatar asked May 28 '11 03:05

demaxSH


People also ask

What is the shortcut key to select line?

To select a line of text, place your cursor at the start of the line, and press Shift + down arrow. To select a paragraph, place your cursor at the start of the paragraph, and press Ctrl + Shift + down arrow.

What is Ctrl K in Visual Studio?

Edit.SelectionCancel. Surround with. Ctrl+K, Ctrl+S. (available only in Visual Studio 2019 and earlier)

How do I select just the line?

Select one character at a time by holding down the "Shift" key and and using either arrow key (right or left). Select an entire line of text by holding down the "Shift" key and pressing "End", if you are at the beginning of the line, or "Home" if you are at the end of the line.


1 Answers

If you want to copy a line, simply place cursor somewhere in that line and hit CTRL+C

To cut an entire line CTRL+X

@Sean found what I was looking for:

To disable this default behavior remove the checkmark (or check to re-enable)

Apply cut or copy commands to blank lines when there is no selection

Accessed from the menu bar: Tools | Options | Text Editor | All languages

You can also enter copy into the options search box for quicker access

[Tested in VS2008, 2010, 2017]

like image 95
Mitch Wheat Avatar answered Sep 20 '22 17:09

Mitch Wheat