A cacophony of ramblings from my potpourri of notes
|
Subscribe
| |  |
Search
Categories
On this page...
| January, 2009 (4) |
| December, 2008 (4) |
| November, 2008 (2) |
| October, 2008 (2) |
| September, 2008 (4) |
| August, 2008 (2) |
| July, 2008 (3) |
| June, 2008 (9) |
| May, 2008 (3) |
| December, 2007 (1) |
| October, 2007 (1) |
| August, 2007 (1) |
| July, 2007 (1) |
| June, 2007 (3) |
| April, 2007 (3) |
| February, 2007 (4) |
| January, 2007 (1) |
| December, 2006 (1) |
| November, 2006 (3) |
| October, 2006 (5) |
| September, 2006 (4) |
| August, 2006 (4) |
| July, 2006 (6) |
| May, 2006 (1) |
| March, 2006 (1) |
| February, 2006 (7) |
| January, 2006 (1) |
| November, 2005 (4) |
| October, 2005 (7) |
| September, 2005 (7) |
| August, 2005 (7) |
| July, 2005 (9) |
| June, 2005 (12) |
| May, 2005 (3) |
| April, 2005 (8) |
| March, 2005 (8) |
| February, 2005 (10) |
| January, 2005 (3) |
| December, 2004 (4) |
| November, 2004 (1) |
| September, 2004 (4) |
| August, 2004 (1) |
| July, 2004 (1) |
| June, 2004 (8) |
| May, 2004 (5) |
| April, 2004 (16) |
| March, 2004 (7) |
| February, 2004 (13) |
| January, 2004 (16) |
| December, 2003 (17) |
| November, 2003 (13) |
| October, 2003 (13) |
| September, 2003 (30) |
| August, 2003 (33) |
| July, 2003 (66) |
| June, 2003 (29) |
| May, 2003 (48) |
| April, 2003 (83) |
| March, 2003 (26) |
| February, 2003 (23) |
| January, 2003 (31) |
| December, 2002 (14) |
| November, 2002 (19) |
| October, 2002 (13) |
|

Saturday, January 03, 2009
Visual Studio Keyboard Shortcuts for Editing (MSDN Flash -Jan. 19, 2009)
Knowing all the keyboard shortcuts for editing shows off our programming prowess, just like it would it did for programmers that could use VI. Rather than describing the well known ones like CTRL+F and CTRL+H, I am going to review some that are more unique to Visual Studio Programming:
Find
- CTRL+I/CTRL+Shift+I
Incremental Search: Turns on incremental search so that characters typed next will be search for in sequence within the file. Use CTRL+Shift+I to search up and ESC to cancel.
- CTRL+Shift+F and Ctrl+Shift+H
- Find in Files: Displays the find dialog with Look in: set to Entire Solution, so that a search will look across all files in the solution and display the results in the Find Results window. Using the up and down arrows, you can select which result to navigate to and then press ENTER to go there. Similarly, Ctrl+Shift+H will perform a search and replace across files in the solution.
- CTRL+K, CTRL+R
Find All References: Takes into consideration the fact that you are navigating source code and, therefore, looks for all references for the item the cursor on. F3 and Shift+F3 will navigate back and fourth between all the references found.
Editing
- CTR+Shift+V
Cycle Clipboard Ring: Did you know that Visual Studio has a clipboard ring? With this keyboard shortcut you copy different text areas, one after the other, without pasting the text in between. After copying you can paste using CTRL+Shift+V - each time will cycle back through what you copied, allowing you to select what to paste, from the set of copied items you placed into the clipboard ring.
- CTRL+Shift+L
Delete the selected line. CTRL+L cuts the selected line into the paste buffer.
- CTRL+Shift+T
Transpose Words: Transpose the current word with the following word, pivoting on the operator separating them. For example, given FirstName = firstName, the transpose keyboard shortcut on FirstName would switch the code to firstName = FirstName. Similarly, Multiply(x,y) would switch to Multiply(y, x).
Outlining
- CTRL+M, M
Toggle outline expansion for the current context.
- CTRL+M, P
Turn off outlining entirely. Reopening the file will re-enable the outlining.
Coding
- CTRL+. and CTRL+K, S
Whenever a smart tag appears (for example after renaming a method or variable), use CTRL+. to display the smart tag menu and then ENTER to select which menu to use. (I can't imagine coding without rename anything significant without rename and this keyboard shortcut.) Similarly, CTRL+K, S displays the surround with context menu, allowing you to surround the selected text with a region for example (C#).
- CTRL+K, L and CTRL+K, P, also CTRL+K, I
List Members: I frequently see other people (okay, I do this myself) deleting the period so that they can see the listing of IntelliSense options again. CTRL+K, L is the keystroke to do this without deleting. Similarly, rather than deleting the left parenthesis, use CTRL+K, P to display the parameter info for the function you are calling. CTRL+K, I will display the help tip for the method you are calling.
- CTRL+K, C and CTRL+K, U
Comments out the currently selected code. These shortcuts are for end-of-line comments rather than block comments. Use CTRL+K, U to un-comment the selected text.
- Shift+ALT+ENTER
Full Screen: Toggles in and out of full screen mode. Great for when you are heads down coding a method and want the most real estate you can get on a single screen.
- CTRL+E, W
Toggle Word Wrap: If you frequently find lines within the code editor going beyond the screen you can toggle on word wrap so that lines wrap. (Personally, I suggest a coding standard that encourages developers not to write 200 character lines). In my books the limit is 72 (a little too small for comfort :)
- CTRL+Shift+F12
Next Error: I should have mentioned this one last week. After compiling, you can navigate between errors using CTRL+Shift+F12.
Saturday, January 03, 2009 11:48:10 AM (Pacific Standard Time, UTC-08:00)
Computer Related | .Net