Decent Editor Wanted

For a long time I’ve used NEdit as my editor. It has a number of annoying quirks, but it’s just about usable. Having just upgraded my desktop to Ubuntu, and found that NEdit compiled with LessTif has even more bugs, and looks really ugly (and I can’t work out in which file to put the X resources given in the beautification tutorial) I’m thinking about a replacement.

Given the general usefulness of editors, and the fact that everyone and his mother seems to have written one, you would have thought it would be quite easy to find one which meets my simple requirements. They are:

  • Currently maintained (i.e. not abandonware)
  • X application, decent-looking
  • Good syntax highlighting
  • Supports, or can be made to support, the key bindings embedded in my brain like Ctrl-C for Copy, Ctrl-V for paste, Tab to indent selection.
  • No vi-like modes. Modal interfaces are bad.
  • Supports standard Perl regexps in the search/replace box

Here’s what I’ve tried, and why I’ve rejected them:

  • nedit:
    • Looks like a dog in Ubuntu
    • Copy and paste to other applications doesn’t work properly
  • gedit:
    • No regular expressions
    • No key rebinding
  • SciTE:
    • Doesn’t support proper regexps
    • Spews pango errors into the console I launched it from (really irritating)
    • Doesn’t notice when files have changed on disk

XEmacs is, I suppose, a possibility, but I’d need to spend an age converting its 1970s keybindings into what the rest of the world uses today. There are some good editors for KDE, but I’d rather not load all the KDE libs on my GNOME desktop just to get an editor. I suspect Eclipse would probably be far too heavyweight.

Anyone got any other ideas, or know anything I’ve missed about some of the above? If you comment, please let me know what editor you are using even if it doesn’t fit my requirements.

56 thoughts on “Decent Editor Wanted

  1. I’m using kedit for the quick and dirty edits. The kdelibs are worth it for that programm alone. A lot of supported languages for highlighting/indentation, transparent support for a lot of protocols (open and save your files on ftp/scp/webdavs/whatever-resources), sensible default key bindings (easy to customize) and definitely not abandonware.
    For Java and big C/C++ or python projects eclipse offers nice support. Code completion and quick fixes are very nice if you’re exploring a new library/project.

  2. Did you personally experience that modal interfaces are bad or are you just believing that what HCI-experts say applies to you?

    You probably guessed that I’m a happy vim user by now. I’m fully aware that modal interfaces are not suitable for everyone in general, but neither are regular expressions which are on your wishlist anyway.

  3. Uh, replace “kedit” with “kate”. I’m obviously a bit tired. And yes, kate does support regexps, copy&paste works well recognises changes on disk well.

    I use vim on the console as well. If only they would add an easily recognizable mode indicator and just one line of online help with the most common and at that moment available commands it would be usable without reading docs beforehand.

  4. Bram: I have used vi (the console version) a few times when it’s all that’s been available. I prefer it to console Emacs in that situation because at least things like the cursor keys work sensibly, and all you need to learn is “i” and “:wp”. But I still didn’t like it much. On the subject of modal interfaces, Caps Lock keys irritate me so extremely that I prise them off any keyboard I have to use more than once or twice.

    Is there a version of vi which is an X application?

  5. Try gvim, a graphical version of vi. I know, it’s still modal, but it adds a menubar, copy-paste integration, syntax-coloring, …

  6. Yep, gvim is a great gui for vim.
    You could also take a look at cream, witch is an interface for vim as well.

    http://cream.sourceforge.net/index.html

    As said on the front page :
    “Cream offers many Vim features through a simple interface common to most software applications. It has menus to access its features and preferences, basic keyboard shortcuts and offers syntax highlighting, spell check, multiple file find/replace, bookmarks, text wrapping and reformatting, line sorting, completion, tag navigation, block commenting, extensive file format and character support, and much more.”

    I think it’s very easy to beginer in vim.
    ctrl+c(x,v) work, you are in edit mode by default (and I think it’s mentioned on the status bar).

    I don’t use it myself (I prefer gvim or vim), but I think it can be interesting.

    Ph

  7. > XEmacs is, I suppose, a possibility, but I’d need to spend an age converting its 1970s keybindings into what the rest of the world uses today

    Try CUA mode which emulates the standard CUA key bindings.

  8. Have you ever tried jEdit? Yes, it’s Java, with a swing GUI, but it’s one of the best editors I’ve ever used. It fulfils all the points you’ve mentioned (though I’ve not tried it on Linux, I can’t say what the GTK look’n’feel is like)

    I’d call it a medium-weight editor – I wouldn’t fire it up just to view a README file, but it’s far lighter than Eclipse. OTOH, it has a great plugin architecture (even better than Firefox’s) and can be turned into a full IDE should you wish. My favourite feature is the Hypersearch bar. Highlight some text, press Alt-. and a sidebar listing all the matches will pop up.

  9. Frustration with Emacs pushed me to try jEdit [http://www.jedit.org/], a cross platform programmer’s text editor written in Java that is customizable with plugins.

    It works pretty well, and fulfills all of your requirements above (albeit using Java regular expressions, not Perl regexps). My only complaint is that plugin management can be finicky — you may be better off ignoring plugins, during an initial evaluation of the editor.

    You don’t need to install it, you can simply carry a JAR file with you wherever you go, and you launch the JAR file to start the editor. However, Windows/Mac installers are available for people who like more integration with the operating system.

  10. Jacob, Paul: I have tried jEdit in the past; it seemed a bit slow then, but I suppose I have a faster machine now. However, it doesn’t seem to be packaged for Ubuntu, which is a minor drawback in terms of ease of re-evaluation.

  11. I really recommend jEdit as a general purpose editor.

    But I disagree with Jacob about the plugins: the plugins are what makes jEdit a powerful tool. I personally recommend: Archive, BufferTabs, Bookmarks, FTP, TextTools, Whitespace, Xilize.

    The search/replace function is really smart and you can even fallback on beanshell to generate replacements. You might also find the block selection useful (hold CTRL and drag the mouse). The block paste is also really smart.

    I’ve been using jEdit on a daily basis for about 5 years now, and my most useful tip is: explore! :-)

  12. “and I can’t work out in which file to put the X resources given in the beautification tutorial”

    They go in $HOME/.Xresources If I remember correctly, you need to either restart X or run “xrdb -merge ” get them read into the server.

    What sort of bugs are you getting w/ Lesstif? I’ve been using Nedit w/ lesstif under SGI, cygwin/x11 and OSX/x11 (definitely not first tier platforms), and never had any issues, except copy/pasting in OSX (even with quartz-wm).

  13. Grev,
    I know you already tried and rejected Scie, but still allow me to comment on that maybe I could get you to reconsider. ;-)

    * Doesn’t notice when files have changed on disk
    You might want to look at the configuration options load.on.activate ( and maybe save.on.deactivate ) for that functionality.

    * Doesn’t support proper regexps
    Scite Supports regexps but I am not sure I know what you mean by propper regexps!
    I usually set find.replace.regexp=1 and find.replace.regexp.posix=1 and find.replace.advanced=1 to get what I want.

    * Spews pango errors into the console I launched it from (really irritating)
    I don’t have this problem -using windows here- but I assume you can use a shell script to launch SciTe which would redirect all the errors to /dev/null or something …

    Just my two liras .

  14. If you have java installed, just download the .jar version of jedit (I’d recommend the development version, 4.3pre2 – it’s rock solid). Then from the command line type: java -jar jedit.jar
    That’ll launch the installer, and it’s easy from there.

  15. Hanspeter: Tried .Xresources, and xrdb -merge, just as the tutorial says – and it seems to have no effect at all.

    As for the bugs, I see the first few on the NEdit Lesstif page, plus annoying ones with focus – Alt-Tab to a window and press Ctrl-F. The Find dialog comes up but you can’t type into it.

    Pat: By “not supporting proper regexps”, I meant \s to mean “whitespace”. At least, that’s the first thing I found and, reading their documentation, there seems to be a lot missing.

  16. There’s always Bluefish, but I imagine it has about as many issues as something like Scite does. I started using bluefish becuase of it’s powerfull web editing tools, and stopped using it because of it’s lack of syntax highlighting for more advanced languages (still use it for a quick edit here and there). Otherwise it’s Vim.

    ~ Anders

  17. I’ll second the jedit recommendations. I value the cross-platform nature (which you may not care about) but I also like the lower barrier to entry than vi/emacs. It is being developed, has excellent syntax highlighting for html/php/python/javascript/perl (all I’ve used it for myself), supports standard key combos and can load other keybindings, no modes, and has most excellent regexp search and replace capabilities (across files in project, across open buffers, etc). Additionally via plugins it goes from editor to ide with project managment, cvs integration, code folding, autoparsing of code files to show listing of classes, methods, functions, etc and autocomplete based on language and local code…

    I can’t vouch for ubuntu, but I’m using it on mepis with the following lines in my apt sources file:

    #jedit
    deb http://dl.sourceforge.net/sourceforge/jedit ./
    deb-src http://dl.sourceforge.net/sourceforge/jedit ./

  18. Oh dear. I just tried to install jEdit:

    gerv@otter:Download$ java -jar jedit43pre2install.jar

    ** ERROR **: file ../../../src/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c: line 572 (createRawData): assertion failed: (data_fid != 0)
    aborting…
    Aborted

  19. Gerv, I couldn’t agree more about the state of text editors in Linux. You’d think after all this coding, and all those text editors for Linux that someone would be able to get it right. We’d of course be wrong. I use gedit, because it comes with Ubuntu and I can’t find anything worth my time to get better.

  20. I use Kate and Eclipse, depending on the length of the project. Kate has fantastic regex searches, and using kioslaves, it can edit files live via SFTP… killer feature.

    Eclipse’s Code Formatting is a dream… a quick CTRL + SHIFT + F and my code is all properly aligned and indented. Good for longer projects, but you’re right about it being a bit bulky.

  21. I’ve long had the same quest. I’ve tried all the editors mentioned. An additional requirement for me is emacs-style meta-completion (Alt-/) which pulls likely matches from all the currently open files. I think I ruled out jedit for not having that, plus the fact that I find Swing UIs intolerable.

    Currently I use Eclipse for anything serious, and gedit for quick edits. I’m always on the lookout for something to replace gedit.

  22. I’m an employee of an embedded tools company (Green Hills Software), so I use our MULTI editor (MULTI is the IDE name) — it’s a nice basic editor and does everything you list, plus it’s cross-platform for Linux/Solaris/Windows. (We use all our tools for native development in-house.)

    Unfortunately for interested folks, the tools cost ~$10,000 per seat. Big barrier to entry if you’re not a corporation with an IT budget… they really are good tools, though, easily the best IDE I’ve ever worked with.

  23. actualy off the requirements Bluefish hits a lot of them

    * Currently maintained (i.e. not abandonware)

    Recently hit 1.0 is actively being improved

    * X application, decent-looking

    Fully GTK2 and looks great with AA fonts

    * Good syntax highlighting

    Probably the biggest hit against it, doesn’t refresh highlighting very well, and limited support for languages

    * Supports, or can be made to support, the key bindings embedded in my brain like Ctrl-C for Copy, Ctrl-V for paste, Tab to indent selection.

    Works like a standard windows text editor, no weird key commands

    * No vi-like modes. Modal interfaces are bad.

    None of them

    * Supports standard Perl regexps in the search/replace box

    “Very powerful search and replace, allowing POSIX and Perl Compatible regular expressions and sub-pattern replacing”

    BlueFish Features

  24. > Caps Lock keys irritate me so extremely that I prise them off any keyboard I have to use more than once or twice.

    Stay away from my computer!

    Heh, seriously on windows I’ve been using Context (context.cx), free but not open source, and have been loving it. I haven’t done to much dev work in Linux, so no favorites yet. Though I’m reading these comments for suggestions on what I should try.

  25. Even if you are a vi hater, you might want to look into vim (as suggested a few times already). It can do everything you list – even the “no vi-like modes” part – although it doesn’t do all of them by default.

    There’s a very easy way make it do all of them by default, though: just use “evim”. If that command is not available on your machine, just create a symlink from “gvim” to “evim”.

    – Michael

  26. I know what you mean – I spend all day coding in NEdit (and occasionally Eclipse). I’ve tried all the editors mentioned so far and I’m not keen on any of them especially Vi/Emacs and derivatives.

    I’d like to find a “modern” version of NEdit, e.g. based on GTK rather than Motif but it doesn’t seem to exist – I’m slightly tempted to work on gedit but to make it comparible to NEdit would require a lot of coding and I don’t (yet) have the motivation.

  27. @Anders: Nope, that’s exactly the one I was talking about. I used 0.0.0.0.0.0.1 versions of it – just when gnome 2 was in alpha/beta. Seeing as I haven’t used it or the Linux desktop since, that’s ‘back in the day’ for me.

  28. “But it does seem odd that the GNOME community doesn’t have a similarly-capable editor.” True, and actually they once had a quite decent one. But all the power user features seem to vanish from GNOME. I’ve always used GNOME and KDE simultaniously (fvwm in the old days) but find myself using KDE more and more exclusively. Very well possible that this is going to change some day. But for now KDE just gives me more productivity tools at hand.

  29. @ James AkaXakA – AH HA I see :) – It seems to be heading down the right path still (I’ve been using it for quite some time as well). It could do with some symplifying of toolbars, and clearing up of some options, and easy ways to import use defined syntax highlighting, but for the most part I really like the way it works. Coupled with Gnomes VFS and editing files live on servers from your desktop is also pretty slick if not a little dangerous.

    ~ Anders

  30. I second the suggestion for Emacs with CUA mode. It gives you C-z undo, C-x cut, C-c copy, C-v paste, Shift-movement selection, type-over-selection replacement, and an awesome rectangle selection mode. Yet, despite that, it doesn’t interfere with the standard Emacs use of C-x and C-c as prefix keys: you still get the prefix key if you 1) don’t have a selection, or 2) hit the prefix key and the following key relatively quickly (well within tolerances for most people’s finger macros), or 3) use a capital letter (C-X, C-C).

    I also recommend:

    • tabbar mode, which gives you something vaguely resembling a Firefox-like tab bar. The following customization gives you Alt-Left and Alt-Right to move between tabs, and puts all tabs in the same group for simplicity:
      (when (require 'tabbar nil t)
      (setq tabbar-buffer-groups-function (lambda (b) (list "All Buffers")) )
      (tabbar-mode)
      (define-key esc-map [left] 'tabbar-backward)
      (define-key esc-map [right] 'tabbar-backward)
      (global-set-key [(meta left)] 'tabbar-backward)
      (global-set-key [(meta right)] 'tabbar-forward))
      
    • C-a for “select all”: (global-set-key [(control a)] ‘mark-whole-buffer)
    • bar-cursor mode, which gives you a bar cursor for insertion, and a block cursor only for overwrite mode.
    • Sane (non-GNU) indentation: (setq c-default-style “bsd”), and probably (setq c-basic-offset 4). If you want non-hanging braces, use (setq c-hanging-braces-alist nil), and if you want no tabs, use (setq-default indent-tabs-mode nil)
    • nxml-mode, for awesome XML editing with context-sensitive completion based on RelaxNG schemas, on-the-fly validation with error marking and descriptions, etc. Just add a schema for XUL, {X,}HTML, gconf, etc.
    • Scroll bars on the right, for a more uniform feel: (set-scroll-bar-mode ‘right)
    • File names in the title bar: (setq frame-title-format “%b – emacs”)
    • Syntax highlighting: (global-font-lock-mode t)
  31. Gerv,

    I think the problem you’re having with jEdit there is that it’s using gcj. I’ve never gotten it to run successfully on gcj, unfortunately; use JRE 1.5 from Sun and it runs great. Just make sure ‘java -version’ at the command prompt is using Sun’s binary.

    Don’t give up on jEdit, it really is a great editor.

    -Dave

  32. I would suggest vim as well. If you do still wish to use your ctl-v and ctrl-c shortcuts, it is relatively easy to map those in vim to what you expect. There are numerous example .vimrcs floating around and you should be able to pick one up from Google. There also is something called evim which is basically modeless vim. Dont know too much about it, but I have grown accustomed to vim and it is difficult to use modeless editors.

  33. Dave: I’d prefer my editor to be free, really. When jEdit runs on gcj or Harmony or the like, I’ll give it a look.

    Those who are recommending emacs, do you mean emacs or Xemacs? Is emacs still console-only?

    I think I might take a look at “cream” (a vi derivative) next.

  34. Is emacs still console-only?

    No, but the current release of GNU Emacs is still in suckyfontland. This should be fixed in the near future though.

    I too am bemused by the fact that it appears that a six-point checklist of reasonable features is impossible to fulfil with a text editor of all things, cosidering they’re probably the most used apps in the world over all time. gedit’s recent Pythonification should help drive it towards that goal.

    – Chris

  35. I’m recommending GNU Emacs; mostly from personal experience, but also because it seems like most packages either run on both emacsen or only on GNU Emacs, but not only on XEmacs. In particular, several of the packages I recommended for ease of use are GNU Emacs only.

    Regarding font suckiness: there are XFT builds of Emacs available, though they aren’t bug-free quite yet (it breaks some of the internal font selection stuff, but not particularly horribly). See http://www.emacswiki.org/cgi-bin/wiki/XftGnuEmacs for information on the branch, and http://freedesktop.org/~keithp/emacs-xft/ for pre-built Debian packages.

  36. Also, regarding Perl regular expressions: grep has a -P option to use Perl regexen, and you should be able M-x grep and M-x grep-find use it by default by setting the appropriate variable.

  37. I installed jEdit on Ubuntu from the apt repository listed from the download page. It works well using the Sun 1.5 JVM, as long as you don’t go nuts with too many plugins.

    I can appreciate that you want to avoid the Java trap. On planet.classpath.org fairly recently (maybe November timeframe?) a posting showed jEdit nearly working with classpath, but I don’t know how the situation has improved since then. Since the Ubuntu Dapper release will be freezing soon I’m concerned that it likely won’t have a Free JVM capable of running jEdit.

    Jext used to be a good competitor for jEdit, but I’m not sure how well maintained it currently is.

    This page http://developer.classpath.org/mediation/FreeSwingTestApps might be of interest.

    -james.

  38. You didn’t mention whether the editor needs to be open source. Komodo, a closed source editor built on the Mozilla platform, meets all your requirements (except possibly for the regexp syntax one–its syntax is similar to Perl’s, but I don’t think it’s exactly the same):

    http://activestate.com/Products/Komodo/

  39. Run textpad 4.7, a lightweight win23 application under wine. (Sorry)

    I’ve just found there are just too many excellent, compact win32 binaries around to ignore (or rule them out) them in X. “Editplus” is another good example.

  40. Gerv got this assertion:

    ** ERROR **: file ../../../src/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImage.c: line 572 (createRawData): assertion failed: (data_fid != 0)
    aborting...
    Aborted
    

    I installed OpenOffice.org on Ubuntu Linux 5.10, then installed jEdit, and had the same problem. The solution is to use Sun’s Java instead of gcj. There are full instructions here.

    Instead of downloading from java.sun.com, as these instructions suggest, I found it easier to visit http://www.java.com. Sun’s confusing, marketing-driven developer site is what most puts me off learning Java.

    jEdit is by far the best free text editor I’ve found for Linux. It has one or two annoyances (such as running out of Java heap on a 3GB machine or failing to set the focus properly when I bring up the Find dialogue box), but its power and flexibility more than compensate.

  41. Sorry for the late post, but in case you’re still listening to this thread…

    Via Wine, I use a Windows app called UltraEdit32. It has all the stuff you talked about. You can update it with multiple language syntax highlighting, it can also detect functions and methods in many languages. It has the regexps like you wanted, and runs perfectly under Wine. It’s the best thing I have found. It even has integrated FTP support for loading and saving files. The only caveat is that it’s not free.

  42. Jedit:

    > An additional requirement for me is emacs-style meta-completion (Alt-/) which pulls likely matches from all the currently open files. I think I ruled out jedit for not having that, plus the fact that I find Swing UIs intolerable.

    Well … jedit has something exactly just like that: complete word (crtl+b … rebindable to anything you wish)

    > such as running out of Java heap on a 3GB machine

    yea, i had such problems, till i specified explcitly to allocate higher amount of memory … no more problems regexping through 40MB xml file … single edit server and multiple instaces makes that less of problem when starting mowe edits later. My usual count of open files is around 20 …

    Autobackup: great … saved my bacon more than once … pull the plug, then swith on, reopen jedit to find all last open files open in same state (edited, not edited, window positions/split posiotions)

    I have some 20 plugins installed, no problems so far (maybe just lucky :), my favourite is JDiff.

    I use macro record ability a lot. Mostly i make compound edit operations from set of regexp replaces (sometimes twaek resulting code macro) then bind to keyboard shorcuts … you’d be amazed what kind of code edit operations i managed to automate this way (from xml formatting to sql generation)

    You can find LOTS of very helpful macros ascoss net … and they usualy tend to give less problems than plugins.

    UI look is quite tweakable (jedit.org -> screenshots)

    syntax coloring is really nice, configured by xml setup file for each file type (“edit mode”), dozens are shipped with editor, you can easily modify, google-out or create new …

    more i use that editor, more great features i find … if anyone is able to bear eclipse for larger jobs, he can definitely appreciate jedit for everyday editing.

    … and i really think that lack of polished, full featured mid-size opensource editors going much further than console is a really weird phenomenon :)

  43. SUB:-please tell me how i can download only vi or vim editor for cygwin software i need not to download whole software

    i have downloaded the cygwin software online which doesnt have any visual editor which gives me faciltiy to editing in the script without making command i want a editor which gives this facility
    OR i want to know how i can do UNIX SHELL PROGRAMMING please tell me any software where i can make the shell programming easily and compile it