jed - Pocket sized emacs
August 19th, 2007 edited by TinchoArticle 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: http://www.jedsoft.org/jed/doc/jedfuns.html
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).
- C-h
- 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
- C-SPACE
- Set the beginning of selection (C-SPACE cancels selection region)
- C-Shift-w
- Cut
- M-Shift-w
- Copy
- C-y
- Paste
- C-a
- Go to the beginning of line
- C-e
- Go to the end of line
August 19th, 2007 at 5:40 am
The console version of jed also has mouse support, add to your .jedrc file the line:
enable_xmouse();
August 19th, 2007 at 8:03 am
emacs also can start very fast by the following command:
emacs -Q
and if you want it inside a console:
emacs -Q -nw
August 19th, 2007 at 12:12 pm
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.
August 19th, 2007 at 4:18 pm
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.
August 19th, 2007 at 9:50 pm
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
August 19th, 2007 at 11:06 pm
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
August 20th, 2007 at 12:29 pm
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 ;-)
August 22nd, 2007 at 9:46 am
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.
August 22nd, 2007 at 6:18 pm
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.
August 24th, 2007 at 1:14 pm
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.
August 27th, 2007 at 7:50 am
> 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.
August 27th, 2007 at 7:51 am
> 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)