13 January 2012 ~ 1 Comment

Never hold down the SHIFT key again

I know you’re a good programmer, and you NEVER copy-and-paste code.

Right? RIGHT?

But sometimes, for whatever reason, you do need to select a chunk of code in the code editor.

How do you do this? Are you a drag-the-mouse-around-and-hope-to-get-it-right kind of programmer? Or are you a hold-down-the-shift-key-and-use-the-arrow-keys kind of programmer?

Whichever you are, forget it, because you’re about to learn a much better way:

Castalia has a feature called “Selection Expansion” that lets you select a chunk of code just by pressing a shortcut key (Ctrl+W by default).

When you press Ctrl+W, Castalia automatically selects the identifier under the cursor. Pressing Ctrl+W repeatedly will continue to expand the selection by logical groups, selecting the current expression, statement, block, etc… until you get the selection you wanted (or the whole method has been selected).

Consider this example (keep reading, there’s a movie at the bottom!):

Pressing Ctrl+W repeatedly selects:

  1. Left
  2. FirstInd.Left
  3. FirstInd.Left+FDragOfs-GutterWid
  4. The entire Trunc() call
  5. The entire Editor.Paragraph.FirstIndent assignment
  6. All of the code in the method
  7. The entire method
Here’s a movie of Castalia’s Selection Expansion in action in the Delphi IDE

Get Adobe Flash player

Selection Expansion is just one of the many ways Castalia saves Delphi programmers time and effort. Learn more (and try it out) at http://www.twodesk.com/castalia.

One Response to “Never hold down the SHIFT key again”

  1. Oliver 15 January 2012 at 6:09 pm Permalink

    That looks extremely cool but isn’t there a step missing? Between C and D I would expect:

    “(FirstInd.Left+FDragOfs-GutterWid) / RulerAdj”

    Cheers,

    Oliver


Leave a Reply