The Source for Java Technology Collaboration
User: Password:



Joerg Plewe

Joerg Plewe's Blog

Little helpers for the editor

Posted by herkules on January 28, 2007 at 11:30 AM | Comments (4)

The NetBeans source code editor is not known the be the ultimate one these days. From what I heard and saw, IDEA seems to be #1 in this respect today. But sometimes even small things have big effects and make work more enjoyable. Sandip Chitale created a set of linetools as a NetBeans module that nobody should miss. It gives a liteweight way to work with lines. It's very easy to move lines around or duplicate them (and then move around). The same works with multiline selections. Very handy, for it avoids prior selection of text in many cases.

Working with that reminded me of an editor feature I created in the glorious times when I was allowed to work in the Forth programming language (my all-time favorite).

Those days I had a line- and a character stack. A single keystroke allowed to swallow or copy lines or characters to the stack and spit them out at another place. This was one of the features you'll never miss again once getting used to it. Much better than the common cut/copy/paste based on selections.

Sandip, please, can you help me (again)?

Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Hi Joerg,

    I am glad you like the Line Tools module. You may also like the rectangular edit tools module also. Check it out my blog.

    Can you please explain more what you mean by "A single keystroke allowed to swallow or copy lines or characters to the stack and spit them out at another place.". May be I will be able to help (again) :)

    Posted by: sandipchitale on February 08, 2007 at 06:36 AM

  • Hi Sandip!

    Nice to see you here. Lets just talk about lines and assume that the keystrokes I mention as an example are not used otherwise.

    Think of a stack of lines and key to push and pop lines to/from that stack from/to the current cursor position.

    E.g. pressing alt-up cuts the current line and pushes it to the stack. alt-up again, next line to stack. Alt-shift-up copies the current line to stack and moves the cursor one line down.
    Then move the cursor to another place an use alt-down to pop line by line from the stack to the current position.

    The same thing can be done with single characters (including linebreaks) e.g. with alt-left/rigth to a separate character stack.

    The whole thing is similar to common cut/copy/paste, just the prior selection is not needed. And it allows e.g. to collect lines from different places to the stack and assemble them to another place.

    Think how practical ctrl-e (delete current line) in NB is. You can do that by selecting the line and deleting it, but ctrl-e is just more handy.
    I love that key.

    What do you think?

    Posted by: herkules on February 08, 2007 at 02:33 PM

  • Haven't thought about it, but I'm sure there are options for some really cool visualization of the stack and the stack actions :).

    Posted by: herkules on February 08, 2007 at 02:38 PM

  • Got it. Should be doable. The line and char stack(s) could be shown in some kind of clipboard window with lines/chars appearing/disappearing as they are pushed/popped. Very interesting idea. Thanks.

    Posted by: sandipchitale on February 08, 2007 at 05:56 PM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds