Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Cross-platform development: editors

by radiantmatrix (Parson)
on Nov 16, 2004 at 20:23 UTC ( [id://408231] : perlquestion . print w/replies, xml ) Need Help??

radiantmatrix has asked for the wisdom of the Perl Monks concerning the following question:

I am a *nix fan at heart. I use Linux exclusively at home, but I've now found myself in an interesting situation: I need to work on Perl for Linux, BSD, Windows, and MacOS/X. Beyond that, actually, I need to use that variety of systems to actually develop on: Linux at home, BSD, Windows, and OS/X at various sites for work.

I read perl editor on windows, Windows Text Editor for Perl, Perl Editor for Windows, and the best perl editor/ide on win32? already, but I'm still left with a question: What's a good editor, with a consistent interface, that works across all those platforms? Killer features, for me:

  • Syntax highlighting. I'm a very visual person, and syntax highlighting is a must for me to be productive.
  • Reasonable resource requirements. As a frame of reference, I find Komodo for Windows to be a bit sluggish.
  • Folding. That is, the ability to visually collapse a block into a line, making it easier to navigate the massive spaghetti of code I'm being asked to maintain.
  • Project support. I'm a sucker for projects a la Komodo: a collection of related files that are linked by virtue of my telling the editor that they belong together, nevermind where they physically reside. Directories are not projects. ;-P
  • Feature and interface portability across platforms. They don't have to be exact between platforms, but menus, toolbars, and shortcut keys should be as similar as possible by default -- or have easily-cloned configuration (think text files).
  • Update: I forgot, multiple workspaces in one window (either tabs, or switching a la screen)

Those are required, what would be nice:

  • Integrated CVS/Subversion. I must use one of those two version-control packages: I don't care which, but it would be nice to have them integrated into the editor.
  • Programmable macros.
  • "Snippet" support. Click button, automagically insert template for module, that I wrote and saved earlier, with project-specific metadata already filled in.

Any ideas? I've tried the ported versions of Emacs and Vim, but I find they both lack features I rely on. The closest I've come is FTE, but it hasn't proved stable on all the OS's, and doesn't have project support.

I welcome your wisdom, O great cross-platform Monks!

Update: I have settled on using Emacs, as the newest version for Win32 seems to work beautifully. Thanks to oknow's suggestion of using the Speedbar, I no longer use folding. As for project management, nothing I've found for Emacs works, so I'm rolling my own. It's essentially a Tk application that reads file names and paths from a flat text file and calls out to Emacs to open them when clicked. Same deal for snippets.

require General::Disclaimer;
Perl is

Replies are listed 'Best First'.
Re: Cross-platform development: editors
by saberworks (Curate) on Nov 16, 2004 at 20:28 UTC
    Have you tried gvim (vim-gtk package on Debian)? It has all the features you listed and more of course.

      gvim, vim cover 4 of the major wants you listed above:

      • syntax
      • resource (only reason emacs sucks)
      • folding
      • X platform features

      the kicker I've usually found is when you are working on a machine w/o enough resources for emacs OR some foreign machine that only has vi (elvis). Then most of the editing attributes you found in vim, gvim are still there .. just degraded.

      Plus vim has reference book and other docs for those who want to get it and an active developer community (scripts etc).

      All hail *Bram Moolenaar*

      gvim has folding and projects? That's the first I've heard ...

      Update: Wow ... maybe I should get out of the stone age of Solaris7 vi and start using a real editor, huh!

      Being right, does not endow the right to be rude; politeness costs nothing.
      Being unknowing, is not the same as being stupid.
      Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
      Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

        Sure does. :help folding and :help session. Well, sessions aren't exactly projects, but they can be, in a vim-hacky sort of way. (It's nice that they save lots of state including ^] history and all that.)
        gvim has folding and projects? That's the first I've heard

        How much have you really investigated VIM? I've used it daily for over two years, and I'm still finding new things. Folding is something I've known existed for some time now, but only in the past few months started using -- but it's been in there for years.

        If you're interested in managing projects in VIM, the excellent project plugin has been a staple of my VIM setup practically from the time I started using it.

        Gvim definitely has folding support. Not sure about projects. It does have support for Ant build files. However, I just recently moved over to gvim from emacs so I know only bits and pieces about vim.

        GNU Emacs has support for all the features that OP asked for.

Re: Cross-platform development: editors
by olivierp (Hermit) on Nov 16, 2004 at 20:46 UTC
    What's missing in emacs ?
    As I don't require / need Project or CVS support, or have access to a Mac, I can't really comment on those parts, although I'm sure something exists, at least for CVS and/or Subversion (PCL-CVS ?)

    For syntax highlighting I prefer cperl-mode (auto-indenting, highlighting, electric parens and other goodies)
    And for folding, folding.el is really useful. This is actually the setup I'm using, for home (Linux only) and office (Win32 only). When I find something interesting, all I need to do is send over my .emacs & the necessary libs (or their links), and it simply works. As for your note on Komodo, it is more than sluggish, be it on Win32 or Linux.
    Subversion's links page points to an emacs backend here
    I'm pretty sure there's something similar for vim, as there is for Eclipse also.
    Update 2:
    I actually forgot emacs' "JDE", which requires ede for projects.

      btw: for emacs, there exists (as well as for vi) some dot-files which help you with the configuration. So I use a adapted .emacs based on the one from Steve Ackermann you can download from - editors - emacs - Win32 Perl configuration for NT Emacs v20.5.1. If you adopt some paths, you can also use it for linux/unix. If you are interested in my enhancements, just tell me and I'll send you my .emacs

      Best regards,
      perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8."

        In addition to the previously mentioned virtues of Emacs, I use another feature that I don't commonly find in other editors. Emacs allows you to transparently (through ftp, I belive) edit files on other machines. If you are doing so much cross-development work, then you must be logging into different machines to edit the files you need.

        To use this mode, type "Ctrl-x f" to bring up the find file prompt. At the prompt, enter something like the following:
        Find file: /user@machinename:/directory/on/remote/machine

        This will prompt you for a password and open the directory on the remote machine. You can also open files directly, but I find it most useful to use Emacs' directory mode.


        Edit: Changed "Meta" to "Ctrl" as johnnywang commented on below

      There's a more standard "folding" mode: outline-mode (and luckily: outline-minor-mode). It takes a bit of setup, but I got it working pretty well using the advice found at:

      Important steps (the Wiki explains in detail):

      • Set cperl-mode/perl-mode up to also use outline-minor-mode
      • Change the awful (C-c '@' C-etc.) keybindings of outline-minor-mode
      • Set up a good outline-regexp and outline-level

Re: Cross-platform development: editors
by gaal (Parson) on Nov 16, 2004 at 20:38 UTC
    You didn't say what you are using in your native environment. Is it Komodo?

    I haven't tried Komodo myself, so I don't know how it compares, but Eclipse is an obvious suggestion (that has been made many times over :). It has all the features you enumerate (except maybe programmable macros, but I don't know what you mean by that). The downside is that it's probably on the resource intensive end of the spectrum, though in my experience it performs better on Windows than on Linux (never tried OS/X).

    Yeah, there's a Perl plugin called EPIC.

      We are also going through an IDE evaluation period and agree strongly with OP's points.

      However, unless it is strangely hidden somewhere, EPIC does not have code folding. In fact I remember there being a poll for wish-list features for the next version; of which one option was folding.

      So it is not even a guaranteed feature to be included in the next version.

        Hmmm, you're right, the folding in eclipse that I saw was for Java files and evidently is part of the JDT, not the Workbench. I stand corrected!
      great tip about EPIC. I used eclipse a while back when I was heavy into java and never knew about (nor pursued) a perl plugin. I always thought you would have to pry emacs out of my cold dead hands. I have been playing with it all day and it's great. Thanks!

      Ah, good point: I currently use Kate or Emacs on Linux (Kate is huge, but I like it) and Komodo or UltraEdit on Windows.

      require General::Disclaimer;
      Perl is

        UltraEdit on Windows is awesome. Sadly, most of my work is in Windows these days.
Re: Cross-platform development: editors
by abclex (Monk) on Nov 16, 2004 at 21:12 UTC

    Have you tried SciTE? It is a reference/demonstration implementation of a free (and open source) multi-platform text/sourcecode edit component called Scintilla. It uses GTK (but afaik there is also a QT port), so it runs on Linux and Windows (installer) and also may run on *BSD and OS X.

    It supports unicode, code folding, syntax highlighting for many languages, multiple buffers (implemented via tabs), sessions (sadly no full project management, but there seems to be an extension for windows), code completion, call tips, has support for building/make process and is highly configurable. But it has no integrated support for snippets and version control.

    There is a LUA extension which makes it scriptable.

    I really like SciTE and use it lot! :-)

      SciTE is what I've been using. I love the fact that it's effectively unchanged between Linux and Windows versions. Everything is exactly where I expect it to be in either version.

      (EDIT: Not that I have much occasion to use the Windows version these days. . . .)

      - apotheon
      CopyWrite Chad Perrin

Re: Cross-platform development: editors
by jacques (Priest) on Nov 16, 2004 at 21:14 UTC
    I've tried the ported versions of Emacs and Vim, but I find they both lack features I rely on.

    I'm a heavy vim user, and I am confident vim supports everything on your list. So does emacs. And both vim and emacs work across the platforms you listed. These are robust editors with a long history of development. It takes time to learn how to use many of their features. I think you should go back and investigate them some more.

Re: Cross-platform development: editors
by dimar (Curate) on Nov 16, 2004 at 20:39 UTC

    jedit has all the features you specified.

      I have just recently started to use jEdit to replace my current OSX editor that is no longer free

      So far I am happy with jEdit on OS X.

      Shirkdog is meditating...
      It does. jEdit is great for perl development, and can be customized easily to your development style. It is very fast despite being written in java.


Re: Cross-platform development: editors
by InfiniteLoop (Hermit) on Nov 17, 2004 at 01:35 UTC
    Hi radiantmatrix,
    (X)Emacs does all that you have listed. With CPerl-mode + auto-fill + etags, I can have all the thingummagic provided by shiny IDE's. Probably these links will help you the most:
    Also these two directives will help you index and navigate the source code from the menu:
    (add-hook 'cperl-mode-hook (function (lambda () (imenu-add-menubar-index))))
    (add-hook 'cperl-mode-hook (function (lambda () (imenu-add-to-menubar 'Func))))
Re: Cross-platform development: editors
by oknow (Chaplain) on Nov 16, 2004 at 20:56 UTC

    I am curious which features that you rely on are missing from Emacs? I can only go by your list, but as far as I can tell everything you want is supported. I use every single thing you mentioned except for Projects. I'm am 99% sure I remember seeing support for something of that nature, but I could be wrong.

    I even use all three of your "nice to have" features. Although in the case of your "Snippet support" instead of "click button" it is "type a very short string."


      My major gripe with Emacs has been how it performs on non-*nix platforms. It seems kind of slow and bloated on Win, for example. Maybe it's just bad luck, but that's how it is for me. I also haven't ever seen any kind of Projects support in Emacs... but I'd be thrilled if someone pointed me to docs for such.

      require General::Disclaimer;
      Perl is

        I can't really speak with much authority one way or the other with regards to the speed of Emacs on win32. I use Emacs minimally on Windows XP under VMWare (Mostly to keep my .emacs working in both win32 and Unix), and it seems to run quite well there.

        I don't use projects myself, but oliverp pointed out Emacs Development Environment. I have not tried using it, so I don't know how well it fits your requirements.

        I am a very big fan of the Speedbar. Since I began using the Speedbar, I've pretty much stopped using folding. It pops up a nice little frame with a list of files and folders. If you drill down into a file that it understands (like a perl script) it will show you a list of all your subs so you can jump to them with just a click. I don't tend to mouse much unless I am not sure of the name of the function I am looking for, and for that purpose this works very well.

        The Emacs Wiki is a very good place to find out just about anything you ever wanted Emacs (and probably lots of stuff you really don't ever want to know :p).

Re: Cross-platform development: editors
by Velaki (Chaplain) on Nov 16, 2004 at 21:43 UTC

    Although it might be hefty, have you looked into Eclipse and its Perl extensions? If you're looking for a full environment, it's not bad. And it supports a host a features.

    Just some thoughts,
    "Perl. There is no substitute."

      One issue with Eclipse is that it doesn't (yet) support drag & drop of text; clipboard operations are needed instead, which is a bit clunky. Apparently it is being looked at for the next version (3.1), but time will tell.

      Having said that, I still use it for project development work due to the other handy features (such as the file history it keeps to allow change tracking for things that aren't CVSed).

       - Spelling is a demanding task that requies you full attention.

Re: Cross-platform development: editors
by Tomasthanes (Acolyte) on Nov 16, 2004 at 21:22 UTC
Re: Cross-platform development: editors
by blahblah (Friar) on Nov 17, 2004 at 07:59 UTC
Re: Cross-platform development: editors
by Vijay (Acolyte) on Nov 17, 2004 at 03:39 UTC
    Hi, I use Emacs on Linux and recently started using Eclipse(with EPIC). Eclipse has all the project management/cvs support(team)/Syntax Highlighting. But as it relies on JVM, and it is a pretty slow when you compare with Emacs.
Re: Cross-platform development: editors
by marcelo.magallon (Acolyte) on Nov 17, 2004 at 17:13 UTC

    You just described vim point for point.

    I *hate* Windows editors of the MSVC sort... when I had to do some development on Windows, I found myself pulling my hair rather too often. And then I downloaded vim precompiled for Windows from Never looked back. You can even use it from MSVC -- even if MSVC users frown at the kind of "integration" that's possible (it won't embed in MSVC)

Re: Cross-platform development: editors
by Tuppence (Pilgrim) on Nov 17, 2004 at 19:37 UTC

    While I agree with the large numbers of people pointing you to various versions of vim, vim also has another benefit that I haven't seen mentioned.

    vim runs in a terminal window

    This means that no matter what box you happen to be sitting in front of, you can always SSH to a server and run vim (with your .vimrc and ~/.vim) and it will always behave the same way (barring Weird Terminal Issues). Together with revision control, this allows you to work on code anywhere in your environment of choice setup for you.

      Likewise Emacs.
Re: Cross-platform development: editors
by Anonymous Monk on Nov 18, 2004 at 10:37 UTC
    Well have you tried looking at editplus, a nice simple editor - without the code folding. Plus works great with wine on Linux as well ....