Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to continue typing after auto-completed pair of brackets/double-quotes?

If you're a programmer you know how important is it to stay on the keyboard and keep the typing flow and simple.

Latest versions of Visual Studio and also Resharper pack adds this functionality which pairs all the brackets and quotes while typing. THIS IS GOOD, DON'T TAKE ME WRONG.

But there is one little problem You need to take your hand off the keyboard's center and play with arrow keys(NOT GOOD AT ALL) when you hit the finishing pair to jump over it.

Scenario (gonna show the blinker location with ^ symbol)

  1. I am in the process of typing string test = "value"
  2. I start typing till hit the string test = "^
  3. And auto-pair does the favor and adds the second pair of quotes as soon as I put the first and the code looks like this in this stage with blinker located in between pairs string test = "^"
  4. I type the string between quotes and reach the finishing pair string test = "value^"

    5a. Now I need to take my hand off the center of the keyboard and press two right arrow keys or 5b. type another double quote. In this case the environment is smart enough not to type the second and jump over it. BUT if I am gonna end up typing it what is the point of pairing it anyways?

I am wondering if there is any key-press or combination which jumps over the second completed pair.

like image 729
Mehrad Avatar asked Jan 15 '14 01:01

Mehrad


3 Answers

Once you get to this point... string test = "value^"

Hit the tab key and it will move past the auto generated character. It works the same for brackets, parenthesis etc..

like image 106
Grant Nelson Avatar answered Oct 19 '22 22:10

Grant Nelson


With Resharper Ctrl+Shift+Enter will put your semi column there.

Complete Statement is a feature that inserts necessary syntax elements (braces, semicolons etc.) and gets you in position to start the next statement.

To check if it isn't overwritten by another key-combination go to:

Visula Studio 2010 >> Tools > Options > Environment > Keyboard...

and type Completestatement int he Show commands containing: textbox.

like image 27
Jim Avatar answered Oct 19 '22 23:10

Jim


If you don't have Resharper, you can try using Ctrl+u.

This shortcut would replace and lowercase whatever letter after the "blinker".

In this case, you would replace and lowercase the ending quotation mark, which will leave you with a quotation mark.

The blinker will be placed after the quotation mark and your hands won't leave the center of the keyboard.

like image 44
dinoxor Avatar answered Oct 20 '22 00:10

dinoxor