jed - Pocket sized emacs

August 19th, 2007 edited by Tincho

Article submitted by François-Denis Gonthier. We have run out of good articles! Please help DPOTD and submit good articles about software you like!

I’m a big fan of GNU Emacs, it’s a very powerful and ultra customisable editor. I have it setup just the way I want, with tons of packages. That means that although my Emacs setup suits me fine for long coding sessions, it takes several seconds to start, even on a moderately fast computer.

When you work in a console, and all you want is to edit some files, and edit them now, you gotta have something that starts in a snap. Jed is the editor I use for that.

Jed showing a bit of Emacs code.

The obvious advantages of Jed are that it starts much faster than Emacs, but still provides the basic key-mappings and features of the default Emacs setup. Out of the box, it supports syntax colouring for several programming languages: C/C++, S-Lang, FORTRAN, LaTeX, Java, Python, Perl, Bash and more. Since it’s an extensible editor, several add-ons (modes) have been written and are available in the Jed Modes Repository.

For people that are interested in having a full-featured editor, but aren’t crazy about the Emacs key bindings, Jed has a nice console menu interface. Menus can be activated with the F10 key, and then browsed with the arrows key, just like the ol’ DOS editors. Most menu items also have shortcuts, for quicker access the next use. For the less expert users, like myself, menus are very useful; but avoiding the F10 key at the corner of the keyboard is a time saver, as tiny as it may sound.

The Jed menus come with some nice touches that Emacs has acquired just recently. In the “Windows” menu, you can see that Jed offers 9 different colour themes for the terminal, a nice touch for people allergic to white-on-black text, or with difficult display devices.

I personally use Jed as a light editor, but Jed is a very customisable platform. It is linked with the S-Lang library, which can be used to heavily customise the editor. I know little of the S-Lang language, just what I need to set a few shortcuts, but the S-Lang functions provided by Jed are well documented on its home page:

It is also interesting to know that Jed has a native X11 interface, which is installed by the xjed package. Jed is not as well adapted to X11 than Emacs is, but XJed does bring some interesting improvements like mouse support, and of course key bindings which are not limited by any terminal protocol. Personally, I think that the XJed default configuration should be edited a bit (I use Ubuntu, but tend to suppose it’s not very different in Debian). When XJed starts on my computer, it looks like Jed was started in XTerm, with extremely tiny fonts, and an ugly font. I am sure XJed can be conveniently and easily configured but giving you a bad first impression of Jed is not something I want. I suggest you to try running the console version of Jed in your favourite terminal emulator, then play with it a bit.

The final proof that Jed is a mature and fully-featured editor is that it obeys Zawinski’s Law (Zawinski’s Law), which state that “a program attempts to expand until it can read mail”. Jed has a mail reader called rmail, it can be invoked by hitting M-x (Alt+x) then typing rmail.

Jed has been available in Debian and Ubuntu for ages.

Quick start shortcuts

Here is a few shortcuts you may find useful while playing with Jed for the first time. As usual, C = Ctrl, M = Meta (usually Alt).

Invoke the help system
C-x C-c
Quit jed
C-x C-f
Open a file
C-x C-k
Close a file
C-x 2
Split a window
C-x o
Move to the next window
Set the beginning of selection (C-SPACE cancels selection region)
Go to the beginning of line
Go to the end of line

Posted in Debian, Ubuntu |

12 Responses

  1. anonomouscoward Says:

    The console version of jed also has mouse support, add to your .jedrc file the line:


  2. kais Says:

    emacs also can start very fast by the following command:

    emacs -Q

    and if you want it inside a console:

    emacs -Q -nw

  3. Richard Says:

    What you need is gnuclient! It allows you to attach to an already running Emacs/XEmacs proccess and use that as the editor, extremely nice powerfeature.

  4. François-Denis Gonthier Says:

    Thank you for your tips, but I knew all that.

    On my computer, emacs -q is still slower than jed at startup because of the number of Debian emacs package I have installed. emacs -q –no-site-file comes close, but it kinda defeat the interest of running emacs IMHO. I’ve got several keys remapped in Emacs and using -q sometimes would mean the keymap would change depending on the way I load emacs. Since I use jed mostly to quickly edit configuration files, and make limited use of the shortcuts, this not really a concern.

    gnuclient is very interesting, but I don’t have an emacs running 100% of the time (yet), so sometimes, using gnuserv would still take as much time as starting emacs.

    I have not given up on using Emacs 100% of the time but for the sake of being productive NOW, jed is for me the next best thing to a full Emacs setup.

  5. ratacolorada Says:

    Great tip! However I haven’t managed to change the colour scheme that opens at the beginning of the jed session? I would like to use the one I use with emacs

  6. François-Denis Gonthier Says:

    Add set_color_scheme(”name of the color scheme you want”) in your .jed/jed.rc.

    I used the example jed.rc that is available in /usr/share/doc/jed-common/examples/jed.rc.gz

  7. Nick Craig-Wood Says:

    zile (Zile Is Lossy Emacs) serves the same purpose also. It is a very minimal emacs style editor with less features than jed.

    Zile has just enough features for that quick config file edit, but for coding I’d use emacs proper. It is a great choice for minimal sized images.

    It has been available in Debian for ages also.

    Running each in a terminal they use the following amount of memory :-

    emacs: 7172k
    jed: 2212k
    zile: 880k

    “Eight Megs And Constantly Swapping” doesn’t sound so bad any more does it ;-)

  8. Johann Spies Says:

    I cannot copy and paste from outside consoles/terms to/from jed. That is a serious handicap. gpm and the mouse on X only works for copy and paste within the context of the editor.

    With Emacs that is not a problem.

  9. François-Denis Gonthier Says:

    This is not really a problem for me since I rarely if ever need to copy/paste outside jed.

    When I need to, Konsole allows to copy/paste, just like xterm would. It’s not a copy in jed par say but it works just as well. I believe Emacs, when run with ‘-nw’, has the same problem.

    xjed probably allows you to copy/paste between X applications just like normal GUI Emacs does.

  10. Evan "JabberWokky" Edwards Says:

    I started off using jed for quick edits to config files, where emacs was overkill. The “quick ssh” type work. Slowly it has become my standard editor, at least partially as I change my daily activities and I adapt jed to them.

    In theory I use emacs and turn to jed for quick edits, but in practice, I must admit I use jed more than I use emacs nowadays. Of course, much of my environment has always leaned more shell scripts based rather than internal to emacs, which helps greatly.

  11. anonymouscoward Says:

    > I cannot copy and paste from outside consoles/terms to/from jed.
    >That is a serious handicap. gpm and the mouse on X only works for copy and paste within the context of the editor.

    Yes the copy/paste is a bit funny, if you want xterm copy/paste in jed use with your mouse clicks/drags.

  12. anonymouscoward Says:

    > I cannot copy and paste from outside consoles/terms to/from jed.
    >That is a serious handicap. gpm and the mouse on X only works for copy and paste within the context of the editor.

    that is [SHIFT] with your mouse clicks

    (Sorry, this forum filters greater-than and less-than)