A Few Editor Tips and Tricks I Learned from the Full Test Pass


I’m getting close to finishing all of our manual test cases for our Full Test Pass, which has helped me tremendously to learn about my new feature area. Here is my list of tips and tricks that I’ve collected over the past couple of weeks:

Tip #1 – Code Drag and Drop

Make sure the Tools – Options – Text Editor – General – Drag and drop text editing checkbox is checked.

Suppose you’re working in a class library and you have two class files opened. You realize, hey, I want to move/copy this class or method to another code file. Or you just want to move/copy certain parts of the code to another location within the same file.

How To Use:

  1. Select the code snippet
  2. Drag to new location
  3. (Press Ctrl for copy)

Tip #2 – Block selection

Did you know you can use block selection?

How To Use:

  1. Press and hold Alt while selecting code via the mouse

Tip #3 – View Visible White Space

Did you know you can view the visible white space?

How To Use:

  1. Go to Edit – Advanced – View White Space

Tip #4 – View the Undo and Redo command stacks on the toolbar

Make sure you have the Text Editor toolbar selected. By default this toolbar should appear whenever you have a file opened in the editor.

How To Use:

  1. Drop down the Undo or Redo button on the toolbar
  2. Select as how far back you want to unwind or rewind the stack

Tip #5 – Tracking Changes

Make sure you have Tools – Options – General – Selection Margin checkbox checked and Tools – Options – General – Track Changes checkbox checked to view Track Changes.

Yellow – you’ve edited these lines since your last save

Green – the lines you’ve edited before your last save. Yellow becomes Green upon saving. Save again and Green disappears.

Tip #6 – Printing with different fonts and colors

Have you ever wanted to print out code file with a larger font or perhaps different colors than your text editor fonts and colors?

How To Use:

  1. Open Tools – Options – Fonts and Colors
  2. Under Show settings for:, select Printer
  3. Apply changes (like increase font size or change colors)

A good way to preview your changes is to make the modifications to your Text Editor settings, then select the Printer settings. The Use Default button changes to Use. Press Use and select “Use Text Editor”.

Comments (2)
  1. Eric says:

    Are these for Whidbey only or do they apply to VS.NET 2003 too? Tip #5 I know is very prominent in Whidbey, but if it works in VS.NET 2003, that would be cool!

  2. Luc Cluitmans says:

    Hmm, your message reminds me of some mixed experiences.

    From end to start:

    #6 – yes, I have found that one after I realized my print-out was ‘all wrong’ (read: ‘not what I expected’). It is good to have these separate settings, but they may come as a surprise the first time you try to print. And it reminds me, when are you finally going to support italics fonts in the editor, and in particular in the printouts? Especially when printing on a black&white printer, italics could give some extra options for printing different parts of code in a clearly distinctive way. I want my comments printed in Italics … Btw, that’s suggestion FDBK11701 in ladybug.

    #5 I like the change tracking. Your ‘save again to clear’ is new to me. What I hate though, is how it interacts with external programs that change the file (read: CVS replacing a version stamp): when the editor detects the file has changed externally it marks the whole file as changed, effectively hiding the previous change information. Logical, but clearing the change information would be better IMHO.

    #4 Yup, nice feature.

    #3 I guess this occasionally comes in handy. I haven’t had the need to use it yet though.

    #2 Great feature, but not a new feature: it was already in VS 2002 IIRC. And most other code editors have this feature. However, IMHO there is one implementation detail of block selection in VS that makes it much less useful than it could be: in VS, when pasting a block, after the paste operation the cursor is to the right of the first line. If you repeatedly paste the same block, you are pasting multiple columns from left to right. In most other editors that support block selection, after a paste operation, the cursor is below the last line (in the first column of the block). When repeatedly pasting the same block, you are extending the one column you were pasting downward. I have found far more uses for this than the VS implementation. I sometimes open a document I have open in VS in another editor (such as the freeware editor ConText) because it gets this feature ‘right’.

    #1 Eh, IMHO this is a big misfeature in editors and word processing software, almost as bad as automatically extending selections to whatever the editor considers to be a ‘whole word’… Luckily one can disable it. Too often I realized I just selected more than I wanted and tried to initialize a new selection by clicking somewhere inside the selection and dragging. And had to spend the next 5 minutes trying to undo the damage of this *bleep* unintended drag-n-drop. There is nothing wrong with being able to *drop* text, but there most definitely is something wrong with being able to *drag* text from a selection. Clicking inside a selection and dragging should cancel the selection and start a new one. If you feel dragging and dropping must be supported, at least require a modifier key to be pressed down when initiating the drag.

Comments are closed.

Skip to main content