Search

JOE Joe’s own editor: a really usable text editor

June 2nd, 2008 edited by Adelie

Article submitted by Neil Stewart. Guess what? We still need you to submit good articles about software you like!

Back in the day, when I was new to Linux, joe was the first text editor that I managed to quit without having to reboot my machine. That I am still using it today, many years later, goes to show just how simple yet powerful joe is. If you don’t want to use emacs (because what’s the point of running two operating systems?) and still can’t work out how to use vi, then joe is for you.

joe is started from the command line with joe or joe filename to edit filename. When you start joe you get a single header bar with information about where the cursor is, what time it is and, crucially, the message «Crtl-K H for help» (^KH in joe shorthand). So if you press Ctrl and K together, release them, and then press and release H, the top half of the screen is given over to a brief list of commands. And it’s here I learnt how to quit (without rebooting), how to open a new file, how to save a file. And how to move the cursor around, how to find and replace, how to skip over words and lines, how to marks blocks of text and move them about. And you can carry on working on your file —you just type— with the help up. So within a really short amount of time you’ll be up to speed.

JOE

But joe is powerful too. For example, you can process any block of text through any shell command. joe’s help file gives a good example. If you mark the block of text by moving the cursor to the beginning and ^KB, then move to the end and ^KK, then pipe the block of text through sort with ^K/ sort. joe then runs the block of text through sort and replaces the block with the result. Powerful, especially in conjunction with old faithfuls like tr and sed.

Search and replace is also easy. ^KF and enter a search term. That’s it. But search and replace is powerful too. You can reuse old search terms by pressing the up cursor key, including terms from previous sessions. You can use tab completion to complete from any of the words in your current document after you’ve typed the first few letters. Then you can choose what to do when you find it. To replace press R and enter the replace term. You can replace one by one, or replace all. ^L finds the next entry. And you can use regular expressions —this is unix after all. Again the help file has a neat example. If you search for \*,\*,\*$ (\* matches zero or more characters and $ matches the end of a line) and replace with \2,\1,\0 (\X matches Xth pattern found) the string «one,two,three» becomes «three,two,one». Bring up help with ^KH and skip a few screens with ^[. a few times to remind yourself of the regular expressions.

Macros are easy too. Start recording one of ten macros with ^K[ and then a digit. Finish the macro with ^K]. Then use ^Kdigit to play the macro.

joe has many more features. joe remembers where it was in the file when you next edit it. joe colours your C, Java, LaTeX, HTML, and many other formats by default. joe indents your source code and justifies your text. joe supports multiple windows. joe can set bookmarks. You can compile your source code from within joe (^[C) and then skip to the errors the compiler identifies (^C= next error, ^C- previous error).

Finally, joe is old, stable, and just works. It’s in version 3.5 in etch and lenny. I use it for everything, all day every day, and it never fails. Find out much more with info joe or at the Sourceforge home page.

Posted in Debian, Ubuntu |

9 Responses

  1. Paggas Says:

    Very nice! I first found about joe using Knoppix, and have been using it ever since - never learned vi or emacs :). I hadn’t noticed these advanced features like piping through shell commands and compiling source code. Very useful!

  2. Carlos Says:

    Curiously, this was also one of the first editors I used when I first used Linux…way back (1998?). However, I never used those advanced features and probably that’s why I moved on to Vi. At the beggining it was very helpful but I never got to learn how to make the most out of it. And because everyone else was using Vi, I ended up learning it…and forget all about Joe. Thanks for remembering :)

  3. kotnik Says:

    Hey, what a pleasant surprise to se Joe featured here :)

    I use it for years. I stumbled on it quite accidentaly, and always install it on every new machine I sit at.

    It’s fast, small, reliable, WordStar like…

    Just one tip, Joe supports + switch for opening file at a requested line. Let’s suppose you greped and found you need to change line 356 at yourfile.txt. What do you do? This:

    joe +356 yourfile.txt

    It saved me a bunch of time. Yeah, I know that other editors support this (I use emacs for programming), but Joe just rules…

  4. Mafeu Says:

    Great! The first paragraph of the article is exactly describing my experience.
    I’m using joe for well over a decade now and it’s the first packet I install after setting up a new machine.

  5. Dinesh Says:

    Well..I’m pretty satisfied with the emacs :) However joe is a good light weight editor to give a try. BTW this article really helps.

  6. Wilmer Says:

    Dinesh, you’ll probably jmacs then. It’s Joe with Emacs-like keybindings.

    I’m still a die-hard joe user, maybe for ten years by now. I never felt a need to switch to vi/emacs. I’m not convinced that the people who picked up joe development a few years ago are adding any value to the product though. :-/ The syntax hilighting is too simple to be useful, and it appears to be buggier now…

  7. Zbigniew Says:

    Anybody knows, how to make - while working with joe - key behave like “real delete” (”eat” the characters”) instead of like - but _under FreeBSD_?

  8. Zbigniew Says:

    Anybody knows, how to make - while working with joe - <Del> key behave like “real delete” (”eat” the characters”) instead of like <Backspace> - but _under FreeBSD_?

  9. anon Says:

    how is joe compared to nano ?