Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keyboard shortcut to select text inside quotes in Visual Studio 2012

Is there a keyboard shortcut (or customizable keyboard shortcut) to select text inside a single quote '' and double quotes "" in Visual Studio 2012.

eg:

string name = "John Doe";

instead of dragging the mouse to select all of John Doe, is there a way to just point the cursor inside the double quotes and press a key combination to select it? Wanting to avoid usage of mouse a much a possible.

I found a similar question

Visual Studio / R# Keyboard shortcuts: select string with or without quotes

but the shortcut given will only select a particular text, not the entire text inside quotes

TIA

like image 543
vishnu Avatar asked Dec 11 '13 09:12

vishnu


People also ask

How do I select a whole line of text in Visual Studio?

Shift + End = Select the entire line from start to end. Shift + Home = Select the entire line from end to start.

What is Ctrl Shift F in Visual Studio?

Ctrl-Shift-F is used to find all the ocuurance of a string with in entire solution and display find result window as shown below. Ctrl-F is used to find a string in the current document, project and all open documents one by one.

How do you select part of a text using the keyboard?

To select a single word, quickly double-click that word. 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.


2 Answers

As of VS2019, with the cursor inside the string, ALT+SHIFT+= will select the whole string, including the surrounding quotes.

like image 63
Frederic Avatar answered Sep 30 '22 15:09

Frederic


TLDR; CTRL+W+W


I am using visual studio 2017 with ReSharper. I don't know if it is ReSharper that added the command or if it is native to VS2017 but using my set-up it is possible to select the text within quotes by putting the cursor in between the quotes and hitting CTRL+W+W

The first CTRL+W will select the word closest to the cursor. Hitting W again will select everything between the quotes.

like image 22
Mathieu VIALES Avatar answered Sep 30 '22 15:09

Mathieu VIALES