Wednesday, September 9, 2009

Visual Studio Efficiency Tip

While working on code it’s sometimes helpful to be able to look at more than one section of code at a time. 

For example, when you’re creating a method that’s similar to an already existing method it helps to be able to see both the old and new methods at the same time. 

Another example is when you’re moving code from one method to another.  In this case, seeing both code sections cuts down on mistakes (less worry about things like “where did I just cut that block of code from…”).

One of my favorite ways to deal with this is to split the code editor window.  I stumbled on it while using Word to edit a document, tried it in Visual Studio and presto! It worked!

Being a keyboard shortcut-o-phile, I’ve setup a shortcut for jumping from one part of the split window to the other (Tools –> Options –> Environment –> Keyboard: Window.NextSplitPane => CTRL+W, CTRL+N).  Since the location of the splitter varies depending on which part of the code needs more space, I tend to establish the split with the mouse.splitting_code_editor

To split the window with the mouse move the cursor to the area circled in green in the image above (above the scrollbar) then click-drag the splitter.  The result, shown below, will be an independently scrollable editor pane.

split_code_editor

No comments :

Post a Comment