I'm not sure how much I've written about this, but you can probably discern by the titles of my blog posts that I'm looking for a good text editor. I think I've finally nailed my frustrations, and I think I have a glimpse of a solution.

Some Background

Back in February, 2 weeks after my first day at Resolver Systems, I switched to Emacs. Before that, I was using TextMate on my Mac, before that Eclipse, before that JBuilder, before that UltraEdit.

I gave up on Emacs because it would was damn hard to make it do it things that should be simpler (like line numbers). My colleague Kamil Dworakowski had a nice Vim configuration, nicely tuned for exactly the work we were doing, so I switched to Vim. Since then I've written a couple of scripts for Vim.

I'm still not 100% satisfied with Vim - it feels old and clunky, but I can't move away from it because I've customised it a lot and I really like the keybindings. I really like to try out alternatives, so I search around.

Reusable editors

Yesterday I came across Eclim, which is a blend of Eclipse and Vim. Its novel idea? Keep using Vim as your editor, take advantage of Eclipse's power (when you're doing Java, I guess). The way it's done is by starting a headless Eclipse instance that exposes an API, and communicating with it. Your editor is still responsive and you get all the cool refactorings and completions that Eclipse provides.

My own experience in integrating PySmell into Vim and TextMate (and my comments on other people's Emacs work), together with the Eclim idea point me to one conclusion:

IDEs and editors should follow the unix motto: Do one thing, do it well

For example, in my case, PySmell is a code-completion provider for Python. It doesn't care what your editor is - given some inputs, it will give you the same outputs. This I way it's easily pluggable into any editor that supports calling an external process.

Two calls

So I give out a call to everybody who makes tools: Rip them out of the IDE! Make them small and reusable! Let the community help you plug them into any editor they want. If your tool is useful, you'll hear from them.

However, not all editors are equal. Emacs can't present overlay windows to list the completions. Vim does, but can't present tooltips. TextMate does both, but doesn't provide Vim keybindings and it's not available on Windows (to my dismay).

So I give out a call to everybody who makes editors: Forget the cool features - forget the languages. Provide a way for other people to do that. Give them APIs, dialogs, panels, popup lists, tooltips. Focus on your core strengths: Editing text, juggling files, searching in a buffer, a pleasant UI.

I realise that this may sound a bit over-the-top. Indeed, all editors which I've mentioned provide that kind of extensibility. However, only one of them is modern (TextMate), and all three of them don't see much activity. I know that there are a lot of projects like MonoDevelop, IntelliPad and more that are making editors - it would be for the benefit of all if they are as extensible as possible.

Interchangeable

My idea summed up becomes: Make the editor IDE-agnostic, and make the IDEs editor-agnostic. They can progress in parallel. They don't evolve at the same rate, so they should be independent. That way, when a cool new language appears, there won't be a lot of posts in newsgroups titled "is there a nice IDE I can use". They will be "is there a library I can plug into my editor", to which people can reply: "not yet, but you can write your own". Writing IDE helpers is much easier than writing text editors, so people will write them.

Imagine if you would be able to pick an editor only for its personality - the UI, the keystrokes for moving around and so on, and then you could use all the nice IDE functionality you wanted -- for free. I think you'll agree that is sounds good!

I'd be really interested to find out what other people thing about this - please comment!

October 29, 2008, 8:02 p.m. More (712 words) 26 comments Feed
Previous entry: The trouble with setuptools
Next entry: PySmell v0.7 is here, supports Emacs, TextMate and Vim

Comments

1

Comment by Emilian , 1 year, 10 months ago :

You've just discovered what every major java IDE supports: a pluggable architecture with various modules for specific programming languges. See how Netbeans handles java, javascript, ruby, etc for example.

2

Comment by Ebrahim , 1 year, 10 months ago :

You noted Eclim. You may also be interested in jVi [http://jvi.sf.net], a great plugin for Netbeans IDE.

3

Comment by Philip Dorrell , 1 year, 10 months ago :

Orestis, I had this problem even with the JDEE, because it seemed to want to turn my Emacs into a version of Eclipse, and I couldn't easily work out how to access the completion features etc to work the way I wanted it to work.

So I wrote my own very limited completion feature. For presenting completion options, I just create a whole new buffer in the same window. You then use a mouseclick or keystroke to select the desired choice (or cancel). This follows what I consider the "Emacs way", which is if an interactive option doesn't fit into the mini-buffer, then put it into a full buffer.

4

Comment by Andrew , 1 year, 10 months ago :

its true major IDE's have plug-in architectures, but plug-ins are not transferable between IDEs.

Sun attempted to standardize this somewhat with JSR 198:
http://jcp.org/en/jsr/detail?id=198

but afaik it never really picked up momentum what with Sun's Netbeans and Eclipse being in fierce competition.

Its kind of a neat idea, but 99% of people are happy with just using an IDE normally and the remaining 1% are probably happy with plug-in features exposing IDE dependent API.

Remember you can configure most editors in terms of appearance and key-bindings :)

5

Comment by Orestis Markou , 1 year, 10 months ago :

It's true that Eclipse and NetBeans provide an API, but being in Java they take things too far - I guess it's a matter of platform philosophy.

I quite like TextMate's API - you get a bunch of information as environment variables, and you decide what to do with your standard output. Simple and constrained enough, to stop people going over the top with hacks. Implement your plugin in whatever script language your system can run. Nice and simple.

6

Comment by buh , 1 year, 10 months ago :

Well, in case you didn't notice, the UNIX philosophy failed because people like you are too lazy to learn to use all the tools.

>So I give out a call to everybody who makes editors: Forget the cool features - forget the languages. Provide a way for other people to do that. Give them APIs, dialogs, panels, popup lists, tooltips. Focus on your core strengths: Editing text, juggling files, searching in a buffer, a pleasant UI.

There's nothing more customizable than the Emacs architecture. You have complete control over almost everything.

As for the overlay windows, I'd pay to get ridden of that annoyance. I think the mini-buffer is a very cool idea.

I can only say this: take a good look on emacs-23. Inspect the manual.

7

Comment by Bill Mill , 1 year, 10 months ago :

I completely agree! I've often wished Vim had a more open design.

@buh: must be nice to live in your world, where interoperability doesn't matter.

(and s/people thing/people think/)

8

Comment by Eric Larson , 1 year, 10 months ago :

One thing that is nice about Emacs is that many of the tool specific modes (ie grep-mode) handles stdout from grep, which means if you wanted to use something grin[1] instead, customizing the output to appear as grep output allows you to use the same mode.

Given, this doesn't directly address your idea (which I like btw), but it is effectively a similar idea.

[1] http://pypi.python.org/pypi/grin

9

Comment by mb , 1 year, 10 months ago :

Just a minor note, completely missing the topic: Vim has tooltips, ballooneval.

That doesn't change the fact however, that it's hard to communicate with outside processes...

10

Comment by olli , 1 year, 10 months ago :

I guess I totally disagree with your statement that IDEs should only do one thing.

It's an *integrated* development *environment*. To me, that means it integrates all your development environment into one application.

If you want a text editor, then use one. An IDE is not a text editor.

11

Comment by clows , 1 year, 10 months ago :

http://www.e-texteditor.com/
is a pretty decent TextMate lookalike for windows (including support for Bundles etc)

12

Comment by RonnyPfannschmidt , 1 year, 10 months ago :

http://pida.co.uk
this ide doesn't reinvent editors, instead it just embeds vim/emacs/medit based on the users preference

13

Comment by spork , 1 year, 10 months ago :

"I gave up on Emacs because it would was damn hard to make it do it things that should be simpler (like line numbers)"

So long as you're using CVS Emacs (there'll be a release really soon now...), that's just

M-x linum-mode

Still slightly confusing in that "line-number-mode" is for the little current line number tracker at the bottom in the "modeline" itself and "linum-mode" is for the line numbers running down the side of the display.

14

Comment by Orestis Markou , 1 year, 10 months ago :

Look Ma, I've started a flamewar!

To clarify myself: There's a lot I don't know about Emacs, and from comments here and on reddit it seems that even when there's no direct support for something, you can probably manage.

I'm arguing that editors should have built in support for things like popup lists, tooltips etc. I understand that it's probably against the Emacs philosophy, let's agree to disagree.

15

Comment by Ron Welch , 1 year, 10 months ago :

For thoughts along the same lines as your "headless" idea, but which extrapolate things quite a bit further, you may want to take a look at Rob Pike's (Bell Labs, now at Google) Acme:

http://plan9.bell-labs.com/sys/doc/ac...
http://en.wikipedia.org/wiki/Acme_(te...)

16

Comment by Olivier Lauzanne , 1 year, 10 months ago :

Mostly I agree with you. Except that IDE by definition don't do one thing, they are an environment, and therefore produce non-reusable components.

That's why I am against IDEs in general and stopped using eclipse (even if it is quite usefull).

The part of the IDE about browsing and searching in certain folder should be a file browser application (for now it is often the terminal when you don't use an IDE). And you should have an editor application for editing files.

I also agree that vim and emacs are old. I'm using gedit, and made an extension that I missed when I needed it. But I would be using TextMate if I was using a mac or kate if I was using KDE. I think those apps are what you actually want, they don't make tea they are just editors that you can easily extend.

17

Comment by Lally , 1 year, 10 months ago :

I like where this is going. Right now, IDEs are giant plugin behemoths designed to do a crappy job of what a window manager already does -- or is that a good job of what a window manager does crappily?

IMHO the underlying issue is that the intercomponent interface is too complex for the standard UNIX pipe/subproc paradigm, and so we've fragmented into API/Interface hell.

Perhaps it'd be easier to enable a common plugin API between the major IDEs? Then let other systems plug themselves in/out?

We already have middleware active on a lot of people's boxes (e.g. dbus), why not just have the "core" IDE just be middleware for the components, which aren't linked into a monolithic API?

18

Comment by Mikael Jansson , 1 year, 10 months ago :

Speaking of extending Vim.

I've merged the SlimVim project's patch of ECL (Embeddable Common Lisp) for 7.2, but without the network fluff that used to be there, and added some docs.

By using NetBeans as a proxy, you should be able to write a wrapper daemon that takes whatever input you have on one side, and stuffs it into Vim (asynch.) via NetBeans. I've sent out e-mail to vim_dev on making a separate asynch interface to vim, but no interest alas. Guess one has to implement it and see what happens.

See http://common-lisp.net/project/limp

19

Comment by Don Schuy , 1 year, 10 months ago :

I recommend Scintila/SciTE. Starts up as fast as notepad. I've run it on Windows,Linux (Fedora) and Mac. It is heavily customizable and uses Lua for a scripting engine. Scintilla is the editor component that can be embedded in other programs. SciTE is a text editor that utilizes it. I've been using it for years now as my favorite editor when I'm not in an IDE. You can setup keys to perform command line compiles and see the output in a status window below the edit area.

20

Comment by Arun , 1 year, 10 months ago :

> I'm arguing that editors should have built in support for things like popup lists, tooltips etc. I understand that it's probably against the Emacs philosophy, let's agree to disagree.

Wrong again. http://www.emacsblog.org/2008/03/13/y...

21

Comment by Orestis Markou , 1 year, 10 months ago :

To all people who call me wrong (and other nasty things) about Emacs' features:

Please, instead of linking to a screenshot or screencast of the feature you showcase, link to the documentation on how to do this. I do want my library to have nice Emacs integration, after all.

22

Comment by Iffy , 1 year, 10 months ago :

You may want to checkout Komodo Edit (http://www.activestate.com/Products/k...) -- vi key bindings and open architecture (same plugin architecture as FireFox)

23

Comment by Lennart Regebro , 1 year, 10 months ago :

"Make the editor IDE-agnostic, and make the IDEs editor-agnostic"

The whole idea of an IDE is that you Intergrate the Developer tools into a coherent Environment, so I'm not sure how that would work, really. :)

You need a editor, syntax highlighting, code completion, project handling and multiple file searching and debugging into one. So the editor should not only edit, but do all these other bits too. Sure, it' nice if that is pluggable so each of these bits are exchangeable, but when an editor has API inputs to plug different bits in to do this, it isn't an editor anymore, it's an IDE. :)

24

Comment by Jonathan Hartley , 1 year, 10 months ago :

Fabulous post, Orestis, I agree wholeheartedly.

25

Comment by jim , 1 year, 10 months ago :

Nice post Oresti,

A good promising editor is Editra, it's written in python, has some nice features, a command mode, a vi emulation mode, and a beautiful pythonic API(yet i dont know how mature it is)

Given it's in its first steps in this cruel world I am pretty impessed!
features
http://editra.org/index.php?page=preview

api example
http://editra.org/index.php?page=doc&...

26

Comment by Michael , 1 year, 9 months ago :

Dear Orestis,

there must be some sort of global subliminal switch-to-emacs conspiracy, because a non-trivial number of people I know have independently tried switching to emacs in the past months, including die-hard vi fans!
e.g.
http://upsilon.cc/~zack/blog/posts/20...

I am still going through an emacs stage, but I'm cheating! There's a viper-mode in emacs which lets you keep using vi keybindings (Meta-X, viper-mode). But you still have to like lisp.

As a matter of fact, the CVS version of GNU emacs has really good unicode support (which is really important) and a lot of nice little other goodies. It seems emacs may be making a comeback.

regards, Michael


This post is older than 30 days and comments have been turned off.