Using Joe as your editor
From NewbieDOC
- Kenward Vaughan
- kaynjay@igalaxy.net (author)
- Tom Huckstep
- (publisher)
- Chris Lale
- chrislale AT users DOT berlios DOT de (publisher)
Go to NewbieDOC index
Revision History
Revision v0.00 | 2001 | Revised by Kenward Vaughan | ||||||||||
Initial version. http://newbiedoc.sourceforge.net/text_editing/joe.html.en | ||||||||||||
| ||||||||||||
Revision v0.01 | 22 February 2001 | Revised by Tom Huckstep | ||||||||||
First SGML draft. | ||||||||||||
| ||||||||||||
Revision v0.02 | 26 January 2006 | Revised by Chris Lale | ||||||||||
Modified for NewbieDOC wiki by converting source to wikitext. Added an abstract. | ||||||||||||
| ||||||||||||
Revision v0.03 | 27th November 2007 | Revised by Chris Lale | ||||||||||
Reformatted for newbiedoc package. | ||||||||||||
Joe is a simple commandline editor apparently based upon/inspired by the old DOS word processor called Wordstar.
1 Why think about a file editor?Linux works with files. All kinds of them. Configuration ones, scripts, data files, the list goes on and on. As one person (of many) once wrote, "In Linux, everything is a file." Guess what? You need a file editor. And while you might plan to spend a lot of time in X Windows, you will likely find the command line your friend after a while. As a non-programmer/Linux-neophyte/once-GUI-oriented sort of fellow, I thought it would be nice to write up a short piece for Debian newbies (or Linux ones in general) about some apps which with almost anyone from outside Linux would quickly feel comfortable. I have used joe at the command line ever since I began with Linux. (I haven't wanted to go through the learning curve associated with emacs or vi. There are too many other things to learn...) 2 Why joe?I can't remember where I heard about joe, but I knew that I wanted the package when I did my 1st install of Debian. It apparently is based upon/inspired by the old DOS word processor called Wordstar (which I have used at least once in the distant past). Joe was touted as a simple editor for the rest of us—those who aren't geeks by nature. Let me explain why. First, if you haven't already installed joe, hook up to the 'Net (or get your Debian CD's out), become root, and type # apt-get install joe then, after installation has finished, fire it up with a simple $ joe or $ joe NameOfNewFile or $ joe NameOfExistingFile at the command line. Warning: If you are still root at this point, be careful! Know what you are changing, because you are god of the system as root! You'll see a blank page created (or the contents of the existing file, if that's how you invoked joe) with a single line at the top giving you some information. 3 That single line of informationThe key here is the `Ctrl-K H for help' part. Help is always in front of your face. Try it now to see what's there. Push and hold the control key while pressing k then release and press h You can see from the help screen the variety of things available (shown below). Note that many (but not all) commands start with the Ctrl-K keystrokes (the control key is commonly abbreviated as a caret, ^ ). Also note that letters do not have to be capitalized, but that undo (Ctrl-Shift--) and redo (Ctrl-Shift-6) do require shifting. If you have opened a file, play with things to see how they work (most are real obvious). Note that the arrow keys, Page Up/Page Down, and Home/End keys also do what you'd expect. Insert acts like space, though. To change to typeover you have to invoke options (^T). CURSOR GO TO BLOCK DELETE MISC EXIT ^B left ^F right ^U prev. screen ^KB begin ^D char. ^KJ reformat ^KX save ^P up ^N down ^V next screen ^KK end ^Y line ^T options ^C abort ^Z previous word ^A beg. of line ^KM move ^W >word ^R refresh ^KZ shell ^X next word ^E end of line ^KC copy ^O word< ^@ insert FILE SEARCH ^KU top of file ^KW file ^J >line SPELL ^KE edit ^KF find text ^KV end of file ^KY delete ^_ undo ^&[N word ^KR insert ^L find next ^KL to line No. ^K/ filter ^^ redo ^&[L file ^KD save ^ is the Control key , ^[ is the same as the Escape key, and ^[L is the same as Escape-L The big ones to note for joe newbies are ^KD (save) ^KX (save and exit) ^C (exit without save—it will ask you about saving) ^KJ (reformat paragraph after making changes which mess up the line wrapping) and the block commands (operating on chunks of text, e.g. a paragraph). People used to a system like Windows may begin to feel anxious at this moment. "WHAT? I have to remember all of Those Things??!!" (Shudders going through body... ;-) It's not that hard, and you may already understand how it works. Have you ever hit the F1 key to get help? That key is called a shortcut because it is a lot easier and faster than moving your hand off the keys over to the mouse, then pointing and clicking on the help menu item, often followed by a necessary second choice off that menu. Joe (and many other command line apps) uses shortcuts by default. When you exit and save changes to an existing file, joe automatically creates a backup of the old file by appending a tilde (~) to the file's name. (This happens when you use the ^KX command, but not when using the ^KD (save, then continue) command.) Other commands of possible immediate interest are the search commands (^KF and ^L) and the spell checker (Do you have ispell installed??). All others are pretty self explanatory. One thing I certainly recommend is playing with an expendable file for a while, learning how to get the most out of joe. Such a file is easy to get—simply copy a file to a new name and toast that one... 4 Other neat thingsWow! Now that I'm doing the writing, I've actually begun to pay attention to all that joe offers, and I stumbled onto a wealth of things I didn't even know existed. This editor has far more to it than initially meets the eye. My eyes had Never picked up the phrase one can plainly read at the top of the Help window when you first type ^KH—the bit saying more help with ESC . ([.) I saw it just tonight as I began to write this document, and tried it. What other goodies I found really impressed this non-geek! Macros, special searches, bookmarks, a calculator, having multiple files open (multiple windows), and running a shell (command prompt) in a second window on top of your file are just part of the rest of this really nice editor. Additionally, I have found joe to be invaluable as my email editor. It automatically does a cool trick when you are fashioning a response to a message and want to reformat the reply. When one quotes another person the quoted part sometimes gets blown off the page, extending beyond the normal limit of columns. This also happens when the other person doesn't properly line wrap their messages. On reformatting such cases, joe automatically adds more quote characters to accomodate new lines mandated by proper wrapping of the lines. The shell session I'm also intrigued with, as it effectively becomes a whole new document. You can copy stuff over to your own document directly, save the session (which you end by typing `exit') to its own file, or just stop and close this new file with a ^C to get back to your original document. 5 Wrap-upJoe does not have all the cool features one hears about in emacs or vi. But for someone needing a nice, very functional editor, it's great. What commands I can't remember are always there where I can see them, and joe does all I've ever needed to do to a file. It is not intimidating, and is easy to pick up since many keys do what you expect them to do. It's well worth having on your system! 6 Appendix A: LicenceCopyright (c) 2001 Kenward Vaughan, kaynjay@igalaxy.net Copyright (c) 2001 Tom Huckstep Copyright (c) 2006-2007 Chris Lale, chrislale AT users DOT berlios DOT de
Go to NewbieDOC index |