views:

1656

answers:

5

We've all seen in-browser rich text editors, which allow you to edit colored/styled text in a WYSIWYG manner. But what about code editors, which automatically highlight code based on language rules as you type? Think Eclipse in a textarea (but without the refactoring support).

Do such things exist? I imagine scaling would be a problem - larger files would be difficult to edit efficiently.

+7  A: 

The editArea javascript library does a pretty good job. It's used by the OpenCMS content management system as it's in-place JSP and JavaScript editor. The colorization gets a bit confused when the file is > 2000 lines or so.

The feature list from their page is:

  • Easy to integrate, only one script include and one function call
  • Tab support (allow to write well formated source code)
  • Search and replace (with regexp)
  • Customizable real-time syntax highlighting (currently: PHP, CSS, Javascript, Python, HTML, XML, VB, C, CPP, SQL, Pascal, Basic, Brainf*ck)
  • Auto-indenting new lines
  • Line numbering
  • Multilanguage support (currently: Croatian, Danish, English, French, German, Italian, Japanese, Polish, Portuguese)
  • Full screen mode
  • Can work in the same environment than "protype" and "mootools"'s like libraries.
Tim Howland
Awesome Thanks!!!
Robert Gould
Nick Perkins
+1  A: 

Javascript VI, has some bugs but is an interesting idea. VI FTW!

http://gpl.internetconnection.net/vi/

hacama
that doesnt work in my browser.. perhaps it is because i am using the vimperator plugin for FF. vim ftw!
+9  A: 

CodeMirror looks interesting, but haven't tried it.

http://marijn.haverbeke.nl/codemirror/

interstar
looks like exactly what I'm after, thanks
Chris Simpson
CodeMirror is great and is used by Google's API playground: http://code.google.com/apis/ajax/playground/
Michael La Voie
doesn't have even basic code completion (like double auto brackets, etc), indentation doesn't seem to work properly, not sure this is a great choice.. (I just tried out their live demo)
Rick
+1  A: 

This is a sideways suggestion -- but I use the Firefox plugin "It's All Text!" to send my text-areas to for editing -- all good markups,searching, etc.

Of course, this is user-dependent, and can't be easily rolled-out to visitors, if that is your intent.

However, I tend to get irritated by the limitations of in-browser editors, anyway. (The way SO captures my C-k during edits STILL catches me off-guard... [which means I don't edit everything in Emacs...])

Michael Paulukonis
this is really helpful actually, I think its one of the best options currently available, for me, I'm trying to build an IDE interface so I can do things like have multiple file folders open at once (I hate scrolling up and down through folders) so this seems like a perfect fit since you can just get the text from a text area and edit it using an external editor
Rick
+7  A: 

As of Feb 2009, Bespin looks very interesting : http://bespin.mozilla.com/

interstar
I saw Bespin also and had been trying to implement (just the embedded version) and can't get it to work, it seems promising but they don't have much documentation so maybe its not the best choice to start out with as I can't find a support forum or anything to get feedback on what I might be doing wrong
Rick