NEdit

NEdit is something new in a Linux programmer's editor.

Here is something new. Not vi, not emacs, not just a wrapper for some hackneyed old Motif widget. With a sparse but sufficient keyboard command set and full regular expression substitutions, NEdit has the best mouse integration I've seen yet in a Linux editor, free or otherwise.

Weighing in at a little over a megabyte for the static-linked Motif binary, NEdit starts up slower than the last editor I wrote about, xvile, but much faster than emacs or xemacs. Scrolling is fast, and command execution shows no perceptible delay.

It's easy to learn, economical on keystrokes due to its excellent mouse support, and not too difficult to customize using X resources; featuring multiple undo/redo, NEdit earns very high marks from me.

Mouse Support

NEdit handles both rectangular and linear regions selected by the mouse. With rectangular regions, you can:

  • Select

  • Resize

  • Drag the region or a copy of it

  • Lay region over destination text

  • Shift text in the destination out of the way

  • Extend or shrink region in any direction

No command or function keys are used for any of these—just mouse clicks, drags, and CTRL, ALT, and SHIFT chording. Many other operations are available via command keys, mostly CTRL- or ALT- modified, including:

  • Cut or paste to cut buffer

  • Left-justify region

  • Replace region with typed text

  • Delete

  • Regular expression substitution

  • Run region through command line filter

Unlike some other editors, rectangular regions are not bound on the right by the shortest line in the region. Likewise, when you move a rectangular region, you can move it as far to the right as you like.

Most things you can do with rectangular regions also work with linear regions, which start some place in a line and incorporate all intervening text until some place in another line. In fact, you can convert between linear and rectangular regions while working with them, just by pressing or releasing the CTRL button.

Linear selection is supported by an xterm, so you may paste text such as command line dialogues, listings of files, and so on, from an xterm directly into a NEdit window. This saves me a great deal of time when filing bug reports and writing release notes.

Motif secondary selection is present also, in both linear and rectangular flavors. This provides some very nice features.

Dragging mouse Button 2 or Button 3 (depending on your flavor of Motif) underlines text; when you release, the underlined text is moved or copied to the location of the I-beam cursor. The position of the SHIFT key chooses move or copy.

If there is a primary selection at this time, the secondary selection replaces it or, if you hold ALT when you release the selection mouse button, it is exchanged with the primary selection. The varieties of secondary selection are great for moving sentences around in a paragraph, re-ordering the clauses of a C language switch statement, or inserting text from one editor window to another.

These mouse-based capabilities alone save me perhaps 80% of the keystrokes I'd use in vi for similar text manipulation tasks.

As is customary under Motif, if you select some text, then begin typing, the typed entry replaces the selected text. This provides the handiest way to delete blocks of selected text, using the backspace key.

Design Philosophy

Mark Edel writes:

The world of GUIs under Unix is a clash of cultures. Unix is all about flexibility and programmability. Modern GUIs are all about uniformity and standards. Finding middle ground is not easy. I'm proud that NEdit can satisfy users who want to change everything (“I want my backspace key to invoke this awk script, and I want all of my buttons blue”) as well as those who want to use it right out of the box and learn at their own pace.

Menus and Dialogs don't automatically make good GUIs. Quality really means working hard to make the program clear, efficient, consistent, modeless, and error-proof. A good GUI under X, for example, must devote a lot of code to basic stability, because critical infrastructure components are not fixed: window management, keyboard focus policy, colors, fonts, key bindings, to name a few.

______________________

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix