Wednesday, November 27, 2013

Tip 1.4: You can use Ctrl+W to select the current word

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Press Ctrl+W at any location on a word to select the entire word. You can have the cursor at the end of word and still have it select the current word (instead of the proceeding white space).



If the cursor is in the middle of some white space, defined as two or more spaces, the white space will be selected.

Happy Programming! =)
Posted by Nils-Holger at 12:12 PM with 988 comments.

Tuesday, November 26, 2013

Tip 1.3: You can use Ctrl+Enter to insert a line above and Ctrl+Shift+Enter to insert a line below

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



In the following example, note the location of the cursor in the middle of the current line. Pressing Ctrl+Enter inserts a blank line above the current line, and Ctrl+Shift+Enter inserts a blank line below the current line. The cursor moves to the beginning of the new line.



Happy Programming! =)
Posted by Nils-Holger at 12:45 PM with 443 comments.

Monday, November 25, 2013

Tip 1.2: How to cycle through the Clipboard ring to paste different things

"Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio", courtesy of 'Sara Ford'

Sara Ford's Blog



Sara Aside

For her, this is yet another one of those moments where she exclaims, "Why can't she ever remember this tip?! It would save her so much time! Argh!" But then again, every time she's reminded about this tip, it's like getting a little gift in the mail.


You can cycle through the past 20 items you've either cut or copied onto the Clipboard via Ctrl+Shift+V. Pretty cool, huh? To illustrate, let's suppose you have two Console.WriteLine() calls and you need to swap the two strings, as shown in the following example:



Start by cutting both strings: "My Love Marathon" first, and "Hello" second. Now go to the first Console. WriteLine() call. When you press Ctrl+Shift+V once inside the parentheses, you'll get the following changes to the code:



Next, move to the second Console.WriteLine() call, and press Ctrl+Shift+V twice in a row. You'll get this:



And you store up to 20 items before the Clipboard cycles, meaning that it'll go back to the first item still recorded on the Clipboard. This is why the feature is called a Clipboard ring.

Happy Programming! =)
Posted by Nils-Holger at 12:51 PM with 609 comments.