Is there a way to make visual studio put the cursor after parentheses?
What I mean is when I'm for example typing my function, who doesn't need any argument, I want VS to put the cursor after parentheses, not inside them.
Related
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
In researching this I have found two answers:
Answer the first
Ctrl+Shift+W will select the text of the word that your cursor is on within a string. Press it again to select the text of the entire string without the quotes, again to select the quotes, again to select the next logical container and so on.
Answer the second
If you use ReSharper you can use Ctrl+Alt+Right Arrow to do the same thing as Ctrl+Shift+W. You can also use Ctrl+Alt+Left Arrow to reduce your selection by one logical container.
In Visual Studio 2013 it was Ctrl+Right Click. You can use Ctrl+Shift+] for Visual Studio 2015 ;)
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.
As of VS2019, with the cursor inside the string, ALT+SHIFT+= will select the whole string, including the surrounding quotes.
I am not aware of such keyboard shortcut.
The following quick trick uses mouse and includes double quotes.
Just double click left to the first double quote, VS will select the entire string (including the enclosing double quotes).
Apparently the functionality that you're looking for doesn't exists (http://msdn.microsoft.com/en-us/library/da5kh0wa.aspx) For do that I use ctrl+shift+ arrows to select quickly but is not a visual studio functionality is global for all text editors.
regards.
In Visual Studio 2013 I was able to do this by Ctrl+Left Click on the start of the string quote (that is on the left side of the (") sign). Moving to VS 2015 this functionality no longer works for me and I would love to know how to trun it back on.
Use (Ctrl + Shift + W) in Visual studio. just move cursor before " and use this combinations of keys.
I am writing a Visual Studio extension. Is there a built-in way to make the visual studio editor treat a certain piece of text (or code) as a single unit? That is, you can only delete this piece of code at once, you cannot delete part of it. Also, can Visual Studio treat a piece of text as a single unit as far as moving the caret is considered? That is, if you are at the beginning of the text and you use the right arrow on the keyword, the caret will go to the end of the piece. This behavior exists with adornments that have non-zero span, however, I don't want to replace the text with an adornment in one case.
So, I have some code for a Rect variable mageSection:
And I'd like to copy the same code for a different variable warriorSection. To achieve this:
So I'd like to know if there is a visual studio shortcut for allow you to change variable name in multiple line in visual studio without refactoring the whole variable name.i.e. I don't have to manually change those names from mageSection to warriorSectionfor these 4 lines.
It is a question about shortcut in visual studio rather than writing functions, as I'd like to know the shortcut for this. Many thanks!
Copy and paste the section of code.
Now select the pasted code and hit Ctrl-H to bring up the Quick Replace dialog.
In the top box, type "mageSection".
In the bottom box, type "warriorSection".
Hit Enter and it will find the first occurrence and replace it.
Hit Enter three more times...done.
If I'm understanding your question correctly you should be able to hold down alt while clicking into multiple lines and change them all at once. Then hit ESC to exit multiline editing.
Given the following code example
someMethod(②someArgument①);③
I know moving the cursor from position ①->② shortcut is CTRL+], is there a ①->③ shortcut.
Is there a keyboard shortcut that escapes the brace when cursor is just left of brace (Not with End key).
In Eclipse, It can easily work with Tab key.
(In Visual Studio) - Try Ctrl+Shift+] - That seems to select text to where you might need to be, but if you press the ] again, by itself, it deselects, but leaves the cursor where you appear to want it.
Is that what you're looking for?
I am working with a visual studio 2005 project with several thousand lines of code.
When I am looking at an IF statement in the code is there anyway to jump to the corresponding ELSE part without scrolling through hundreds of lines of code? I can't use goto as the line numbers will change all the time. If I can't automatically jump to the else part of an if statement, can I set up something to allow me to tag the else part and then go to that tag in visual studio?
You can use Ctrl+] to jump to the matching brace or parenthesis. So you can place your cursor on the brace of the if statement and press the shortcut to go to the end of the block and thus directly in front of the else.
Another option would be to set bookmarks with Ctrl+B, T. Those move when the line moves as well and you can jump between them with Ctrl+B, N and Ctrl+B, P.