#022 Delete the beginning white space for selected line(s)

Weather you are trying to copy/paste some code into an IM for a friend to look at, or want to better align your source code, you will want to start by removing he white space at the beginning of the line. This quick trick shows you how.

[CTRL]+K, [CTRL]+\ = Remove all white space at the beginning of the line

[Read more…]

#021 Transpose Characters, words, and lines in the editor

Moving text around is something we all need to do frequently. This trick shows you how to transpose characters (which is great for fixing typos), words, and lines with their neighbors. Characters flip with their neighbor to fix a type or spelling error. Words switch left and right to quickly move a word down the line (by repeating the process) and moving the line is a great way to move a line up or down without using cut/paste.

[CTRL]+T = Transpose a character

[CTRL]+[SHIFT]+T = Transpose a word

[ALT]+[SHIFT]+T = Transpose a line

[Read more…]

#020 Create New Line; Above and Below your Current Line

Need a new line above what your currently typing? Imagine this walk through. [HOME],[ENTER],[UP]. Three keys to get a new line. There is a shortcut reducing this to two keys. This quick trick shows you two keyboard shortcuts to enter line lines, one for above, and one for below your current focused line.

[CTRL]+[ENTER] = Insert Line Above

  • (Same effect as [HOME],[ENTER],[UP])

[CTRL]+[SHIFT]+[ENTER] = Insert Line Below

  • (Same effect as [END],[ENTER])

[Read more…]

#018 Format Document, and Format Selection

Visual studio wants you to be happy 🙂 If you like breaks before braces, and after; if you like self closing <br /> tags, if you don’t want self closing <br /> tags. Whatever your fancy, you can automatically have Visual Studio apply with a very quick keyboard combination. This is extremely helpful when you are looking at source code created by someone else. Maybe on your current team, or just an old project.

[CTRL]+[K],[D] = Format Document

[CTRL]+[K],[F] = Format Selection

[Read more…]

#017 Keyboard Shortcut to Comment and Uncomment Code

Commenting code is great. We all do it, all day long. Commonly I’ll see the following done to comment multiple lines of C# code.

[HOME],[/],[/],[UP],[HOME],<Repeat />

This just takes too long. It’s too many keystrokes. This Quick 2 minute video shows you all about commenting, and uncommenting, and even has an added little trick to know about ASP.NET (ASPX) Commenting.

[CTRL]+[K],[C] = Comment the current line, or selected lines of code

[CTRL]+[K],[U] = Uncomment the current line, or selected lines of code

[Read more…]