Nedit – A Text Editor for Linux with Some Killer Features


I’ve been using Nedit for at least 10 years as my primary text editor.     It has standard features for a programmer’s text editor:

  • Syntax highlighting
  • Line numbering
  • Brace matching

There are a few areas in which the authors put in a lot of attention to detail.  It outshines every other text editor that I’ve ever used in these areas.

The Search and Replace Dialog

Search and replace dialog in nEdit

This search and replace dialog is to me the gold standard for search and replace functionality in a text editor.   I have used every option and button in this dialog with the exception of the “Whole Word” option.  

The selection of buttons at the bottom is genius.  I can choose the action and context in a single click.    Using “Keep Dialog” in conjunction  with “Replace & Find” allows you to review each replacement one at a time.  

The regular expression support is perfect.  Unlike other editors (cough eclipse) it allows regular expressions to match multiple lines.

Command Line Integration

Nedit is the only Linux program that I’ve ever used that does exactly what I want when I open a file from the command line with it.

  • Open first file (nedit file1.txt) — Opens nedit with a single file in it.
  • Open second file (nedit file2.txt) — Creates a second tab within the already open nedit for the second file.
  • Move to another virtual desktop, open a third file (nedit file3.txt) — Opens a new nedit window on the new desktop with the third file in.

In short, nedit knows that it should have one instance per virtual desktop and that it should have tabs for all the files opened on that desktop.  Again, perfect attention to detail that makes other text editors look completely inferior.

Speed

Nedit takes about 100 milliseconds to start up and show the editor window.  I have never used a GUI program of any sort that is able to deliver that sort of startup speed.  Many editors that I’ve used take seconds to open. A full development environment like eclipse may take minutes.

Block Selection

nEdit block select

Usually, text selection is done line by line, but by selecting while holding down the ctrl key, nedit allows block selection.    I’ve gotten so used to using it that I get frustrated when text editors don’t support it.

Macros

Nedit supports recording and playing back keystrokes.   Macros can even invoke search.  This makes repetitive editing tasks a breeze.  Again, once I’m used to it, its frustrating to use a text editor that doesn’t have it.

Drawbacks

Unfortunately nedit has a big problem that prevents me from using it as my only text editor: Non-support of Unicode. Nedit was written to support ONLY Latin-1 characters.   This makes nedit useless on any files with non-latin-1 characters.

It is also difficult to get working with a reasonable set of fonts. To get the fonts for the menus to render nicely, I start nedit with the following command line: LANG=en_US nedit-nc -noask -xrm "*renderTable: rt" -xrm "*rt*fontType: FONT_IS_XFT" -xrm "*rt*fontName: Sans" -xrm "*rt*fontSize: 10" I can’t figure out how to get anti-aliased fonts working in the editor pane itself. I end up using -misc-fixed-medium-r-normal--14-110-100-100-c-70-iso8859-1 as an acceptable (but not great) font there.

An Nedit Replacement?

So is there another editor that can be as good as nedit for the features I like about nedit?  I haven’t found one yet.

I use Eclipse more than I used to.  It isn’t fast.  Command line integration is non-existent.  Regular expression support is poor.  There are no macros and no block select.

I use gEdit sometimes.  It is slower and clunkier than nedit but it does support unicode.  Its search and replace functionality is probably its weakest comparison.

Download Nedit

Nedit appears to be “unsupported” and “undeveloped” these days. its website is now offline. Nedit can be downloaded from sourceforge. The version of nedit that is availabe from apt on Ubuntu is now acceptable as well, so I install with sudo apt-get install nedit


Leave a comment

Your email address will not be published. Required fields are marked *

15 thoughts on “Nedit – A Text Editor for Linux with Some Killer Features

  • thej

    I’m coding with NEdit many hours every day. No other editor offers the same efficiency – kate comes close but would need a better search behavior (remember selected text for “search again”, offer a buffer where previously searched expressions are stored, and allow to search for the same expression in all open documents), and block selection. If the kate developers add these features, I might switch to kate, but until then, NEdit is still the king.

    • David Fremlin

      Like you, I’ve been using nedit for many years, and like it very much. Thank you for telling me about “block selection”! Now I have a problem which you very likely haven’t encountered. I use an English-style keyboard with a £ sign (Unicode U+00A3).
      Everything seems to work with nedit except for this, which comes out as £ in two characters. I can always delete the  (it’s a bit of a toss-up what a printer will do with this, but my printer isn’t working at the moment anyway), but it’s irritating, and curiously it’s treated differently in “find”, so that there is no way of searching for the single character £. There seems to be something called “key binding” which might be able to handle this, but I can’t make it work. Have you any suggestions? The problem doesn’t arise with gedit so it’s not obviously a fault in my X system. Incidentally on my late regretted Ubuntu 2.4 or thereabouts there wasn’t a problem.

  • Timothy Lowe

    Hello,

    I use Nedit at work and I am looking at changing my default
    include file directory. That is when I do ALT+I it currently opens
    in my home/Mail/drafts dir but I would like it to open some where else. Do you know how I can change this please? Thank you.

    Cheers,
    Timothy

    • Stephen Post author

      Nedit appears to use the current working directory as the starting place for the includes.
      You can change it by starting Nedit in a different directory. A shell script like this would do the trick:

      #!/bin/sh
      cd /home/me/includes && nedit "$@"
      
  • MY

    I’ve been using nedit for over 10 years now. After upgrading to Ubuntu 12.04, I find it unusable. Copy and paste fails because the keyboard is locked; fonts don’t work properly; the bar containing the tabs keeps expanding vertically; etc. Is there an alternative that works similarly and preferably the sme? I can’t find one.

      • MY

        Firstly, I meant the clipboard gets locked not the “keyboard is locked.” This happens if you have multiple instances of nedits open.

        At work we upgraded to 12.04. I’ve seen that other people have the issue I reported related to the clipboard getting locked and the fonts, and they said it’s an issue of Motif. From what I see, the only option is to use a new editor. I am using Nedit 5.6, which was published recently.

  • john

    Try the following to see if you like:

    1) sublime text 3.
    1) atom.

    I am at the same situation as you are and have been searching good text editors for years after nedit’s development stoped.

  • Mats Rosengren

    I have been using “nedit” for years! Now I downloaded the current version to run on a SUSE 42.2 system. A bug has appeared! The cursor symbol often stays on the positions the cursor have been to making the text unreadable! This seems to happen only when the editor screen is in “part screen mode”. If the developers do not correct this in a new release the “nedit” project is dead!

    • JoeKommespaeter

      I liked nedit over years. But now nedit is retired on my system.
      Take a look for SciTE. Do some minor configuration changes and it looks like a more powerful nedit.
      SciTE is a good “Nedit Replacement” for me.