1JOE(1) General Commands Manual JOE(1)
2
3
4
6 joe - Joe's Own Editor
7
9 joe [global-options] [ [local-options] filename ]...
10
11 jstar [global-options] [ [local-options] filename ]...
12
13 jmacs [global-options] [ [local-options] filename ]...
14
15 rjoe [global-options] [ [local-options] filename ]...
16
17 jpico [global-options] [ [local-options] filename ]...
18
20 JOE is a powerful ASCII-text screen editor. It has a "mode-less" user
21 interface which is similar to many user-friendly PC editors. Users of
22 Micro-Pro's WordStar or Borland's "Turbo" languages will feel at home.
23 JOE is a full featured UNIX screen-editor though, and has many features
24 for editing programs and text.
25
26 JOE also emulates several other editors. JSTAR is a close imitation of
27 WordStar with many "JOE" extensions. JPICO is a close imitation of the
28 Pine mailing system's PICO editor, but with many extensions and
29 improvements. JMACS is a GNU-EMACS imitation. RJOE is a restricted
30 version of JOE, which allows you to edit only the files specified on
31 the command line.
32
33 Although JOE is actually five different editors, it still requires only
34 one executable, but one with five different names. The name of the
35 editor with an "rc" appended gives the name of JOE's initialization
36 file, which determines the personality of the editor.
37
38 JOE is free software; you can distribute it and/or modify it under the
39 terms of the GNU General Public License as published by the Free Soft‐
40 ware Foundation. I have no plans for turning JOE into a commercial or
41 share-ware product. JOE is available over the Internet from
42 www.sourceforge.net/projects/joe-editor.
43
44
46 To start the editor, type joe followed by zero or more names of files
47 you want to edit. Each file name may be preceded by a local option
48 setting (see the local options table which follows). Other global
49 options, which apply to the editor as a whole, may also be placed on
50 the command line (see the global options table which follows). If you
51 are editing a new file, you can either give the name of the new file
52 when you invoke the editor, or in the editor when you save the new
53 file. A modified syntax for file names is provided to allow you to
54 edit program output, standard input/output, or sections of files or
55 devices. See the section Filenames below for details.
56
57 Once you are in the editor, you can type in text and use special con‐
58 trol-character sequences to perform other editing tasks. To find out
59 what the control-character sequences are, read the rest of this man
60 page or type ^K H for help in the editor.
61
62 Now for some obscure computer-lore:
63
64 The ^ means that you hold down the Control key while pressing the fol‐
65 lowing key (the same way the Shift key works for uppercase letters). A
66 number of control-key sequences are duplicated on other keys, so that
67 you don't need to press the control key: ESC will work in place of ^[,
68 Del will work in place of ^?, Backspace will work in place of ^H, Tab
69 will work in place of ^I, Return or Enter will work in place of ^M and
70 Linefeed will work in place of ^J. Some keyboards may give you trouble
71 with some control keys. ^_, ^^ and ^@ can usually be entered without
72 pressing shift (I.E., try ^-, ^6 and ^2). Other keyboards may reassign
73 these to other keys. Try: ^., ^, and ^/. ^SPACE can usually be used
74 in place of ^@. ^\ and ^] are interpreted by many communication pro‐
75 grams, including telnet and kermit. Usually you just hit the key twice
76 to get it to pass through the communication program.
77
78 Once you have typed ^K H, the first help window appears at the top of
79 the screen. You can continue to enter and edit text while the help
80 window is on. To page through other topics, hit ^[, and ^[. (that is,
81 ESC , and ESC .). Use ^K H to dismiss the help window.
82
83 You can customize the keyboard layout, the help screens and a number of
84 behavior defaults by copying JOE's initialization file (usually
85 /etc/joe/joerc) to .joerc in your home directory and then by modifying
86 it. See the section joerc below.
87
88 To have JOE used as your default editor for e-mail and News, you need
89 to set the EDITOR and VISUAL environment variables in your shell ini‐
90 tialization file (.cshrc or .profile) to refer to JOE (joe usually
91 resides as /usr/bin/joe).
92
93 There are a number of other obscure invocation parameters which may
94 have to be set, particularly if your terminal screen is not updating as
95 you think it should. See the section Environment variables below.
96
97
99 The following global options may be specified on the command line:
100
101
102 -asis Characters with codes above 127 will be sent to the terminal as-
103 is, instead of as inverse of the corresponding character below
104 128. If this does not work, check your terminal server.
105
106
107 -backpath path
108 If this option is given, backup files will be stored in the
109 specified directory instead of in each file's original direc‐
110 tory.
111
112
113 -baud nnn
114 Set the baud rate for the purposes of terminal screen optimiza‐
115 tion. Joe inserts delays for baud rates below 19200, which
116 bypasses tty buffering so that typeahead will interrupt the
117 screen output. Scrolling commands will not be used for 38400
118 baud. This is useful for X-terms and other console ttys which
119 really aren't going over a serial line.
120
121
122 -beep Joe will beep on command errors and when the cursor goes past
123 extremes.
124
125
126 -columns nnn
127 Sets the number of screen columns.
128
129
130 -csmode
131 Continued search mode: a search immediately following a search
132 will repeat the previous search instead of prompting for new
133 string. This is useful for the the ^[S and ^[R commands and for
134 when joe is trying to be emacs.
135
136
137 -dopadding
138 Joe usually assumes that there is some kind of flow control
139 between it and the tty. If there isn't, this option will make
140 joe output extra ^@s to the tty as specified by the termcap
141 entry. The extra ^@s allow the terminal to catch up after long
142 terminal commands.
143
144
145 -exask This option makes ^KX verify the file name that it's about to
146 write.
147
148
149 -force This option makes sure that the last line of the file has a
150 line-feed which it's saved.
151
152
153 -help The editor will start with the help screen on if this option is
154 given.
155
156
157 -keepup
158 Normally the column number and control-key prefix fields of the
159 status lines are on a one second delay to reduce CPU consump‐
160 tion, but with this option they are updated after each key-
161 stroke.
162
163
164 -lightoff
165 The block highlighting will go away after any block command if
166 this option is given.
167
168
169 -lines nnn
170 Sets the number of screen lines.
171
172
173 -marking
174 Text between ^KB and the cursor is highlighted (use with
175 -lightoff and a modified joerc file to have drop-anchor style
176 block selection).
177
178
179 -mid If this option is set and the cursor moves off the window, the
180 window will be scrolled so that the cursor is in the center.
181 This option is forced on slow terminals which don't have
182 scrolling commands.
183
184
185 -nobackups
186 This option prevents backup files.
187
188
189 -nonotice
190 This option prevent the copyright notice from being displayed
191 when the editor starts.
192
193
194 -nosta This option eliminates the top-most status line. It's nice for
195 when you only want to see your text on the screen or if you're
196 using a vt52.
197
198
199 -noxon Attempt to turn off ^S/^Q processing. This is useful for when
200 joe is trying to be WordStar or EMACS.
201
202
203 -orphan
204 When this option is active, extra files on the command line will
205 be placed in orphaned buffers instead of in extra windows. This
206 is useful for when joe is trying to be emacs.
207
208
209 -pg nnn
210 This specifies the number of lines to keep after PgUp/PgDn
211 (^U/^V). If -1 is given, half the window is kept.
212
213
214 -skiptop nnn
215 Don't use the top nnn lines of the screen. Useful for when joe
216 is used as a BBS editor.
217
218
219 Each of these options may be specified in the joerc file as well. In
220 addition, the NOXON, BAUD, LINES, COLUMNS and DOPADDING options may be
221 specified with environment variables.
222
223 The JOETERM environment variable may be set to override the regular
224 TERM environment variable for specifying your terminal type.
225
226 The following options may be specified before each filename on the com‐
227 mand line:
228
229
230 +nnn The cursor starts on the specified line.
231
232
233 -crlf Joe uses CR-LF as the end of line sequence instead of just LF.
234 This is for editing MS-DOS or VMS files.
235
236
237 -wordwrap
238 Joe wraps the previous word when you type past the right margin.
239
240
241 -autoindent
242 When you hit Return on an indented line, the indentation is
243 duplicated onto the new line.
244
245
246 -overwrite
247 Typing overwrites existing characters instead of inserting
248 before them.
249
250
251 -lmargin nnn
252 Sets the left margin.
253
254
255 -rmargin nnn
256 Sets the right margin.
257
258
259 -tab nnn
260 Sets the tab width.
261
262
263 -indentc nnn
264 Sets the indentation character for ^K, and ^K. (32 for SPACE, 9
265 for TAB).
266
267
268 -istep nnn
269 Sets the indentation step for ^K, and ^K..
270
271
272 -linums
273 Line numbers are displayed before each line.
274
275
276 -rdonly
277 The file is read only.
278
279
280 -keymap name
281 Use an alternate section of the joerc file for the key sequence
282 bindings.
283
284
285 These options can also be specified in the joerc file. They can be set
286 depending on the file-name extension. Programs (.c, .h or .p exten‐
287 sion) usually have autoindent enabled. Wordwrap is enabled on other
288 files, but rc files have it disabled.
289
290
292 Basic Editing
293 When you type characters into the editor, they are normally inserted
294 into the file being edited (or appended to the file if the cursor is at
295 the end of the file). This is the normal operating mode of the editor.
296 If you want to replace some existing text, you have to delete the old
297 text before or after you type in the replacement text. The Backspace
298 key can be used for deleting text: move the cursor to right after the
299 text you want to delete and hit Backspace a number of times.
300
301 Hit the Enter or Return key to insert a line-break. For example, if
302 the cursor was in the middle of a line and you hit Return, the line
303 would be split into two lines with the cursor appearing at the begin‐
304 ning of the second line. Hit Backspace at the beginning of a line to
305 eliminate a line-break.
306
307 Use the arrow keys to move around the file. If your keyboard doesn't
308 have arrow keys (or if they don't work for some reason), use ^F to move
309 forwards (right), ^B to move backwards (left), ^P to move to the previ‐
310 ous line (up), and ^N to move to the next line (down). The right and
311 left arrow keys simply move forwards or backwards one character at a
312 time through the text: if you're at the beginning of a line and you
313 press left-arrow, you will end up at the end of the previous line. The
314 up and down arrow keys move forwards and backwards by enough characters
315 so that the cursor appears in the same column that it was in on the
316 original line.
317
318 If you want to indent the text you enter, you can use the TAB key.
319 This inserts a special control character which makes the characters
320 which follow it begin at the next TAB STOP. TAB STOPS normally occur
321 every 8 columns, but this can be changed with the ^T D command. PASCAL
322 and C programmers often set TAB STOPS on every 4 columns.
323
324 If for some reason your terminal screen gets messed up (for example, if
325 you receive a mail notice from biff), you can have the editor refresh
326 the screen by hitting ^R.
327
328 There are many other keys for deleting text and moving around the file.
329 For example, hit ^D to delete the character the cursor is on instead of
330 deleting backwards like Backspace. ^D will also delete a line-break if
331 the cursor is at the end of a line. Type ^Y to delete the entire line
332 the cursor is on or ^J to delete just from the cursor to the end of the
333 line.
334
335 Hit ^A to move the cursor to the beginning of the line it's on. Hit ^E
336 to move the cursor to the end of the line. Hit ^U or ^V for scrolling
337 the cursor up or down 1/2 a screen's worth. "Scrolling" means that the
338 text on the screen moves, but the cursor stays at the same place rela‐
339 tive to the screen. Hit ^K U or ^K V to move the cursor to the begin‐
340 ning or the end of the file. Look at the help screens in the editor to
341 find even more delete and movement commands.
342
343 If you make a mistake, you can hit ^_ to "undo" it. On most keyboards
344 you hit just ^- to get ^_, but on some you might have to hold both the
345 Shift and Control keys down at the same time to get it. If you "undo"
346 too much, you can "redo" the changes back into existence by hitting ^^
347 (type this with just ^6 on most keyboards).
348
349 If you were editing in one place within the file, and you then tempo‐
350 rarily had to look or edit some other place within the file, you can
351 get back to the original place by hitting ^K -. This command actually
352 returns you to the last place you made a change in the file. You can
353 step through a history of places with ^K - and ^K =, in the same way
354 you can step through the history of changes with the "undo" and "redo"
355 commands.
356
357 When you are done editing the file, hit ^K X to exit the editor. You
358 will be prompted for a file name if you hadn't already named the file
359 you were editing.
360
361 When you edit a file, you actually edit only a copy of the file. So if
362 you decide that you don't want the changes you made to a file during a
363 particular edit session, you can hit ^C to exit the editor without sav‐
364 ing them.
365
366 If you edit a file and save the changes, a "backup" copy of that file
367 is created in the current directory, with a ~ appended to the name,
368 which contains the original version of the file.
369
370
371 Word wrap and formatting
372 If you type past the right edge of the screen in a C language or PASCAL
373 file, the screen will scroll to the right to follow the cursor. If you
374 type past the right edge of the screen in a normal file (one whose name
375 doesn't end in .c, .h or .p), JOE will automatically wrap the last word
376 onto the next line so that you don't have to hit Return. This is
377 called word-wrap mode. Word-wrap can be turned on or off with the ^T W
378 command. JOE's initialization file is usually set up so that this mode
379 is automatically turned on for all non-program files. See the section
380 below on the joerc file to change this and other defaults.
381
382 Aside for Word-wrap mode, JOE does not automatically keep paragraphs
383 formatted like some word-processors. Instead, if you need a paragraph
384 to be reformatted, hit ^K J. This command "fills in" the paragraph
385 that the cursor is in, fitting as many words in a line as is possible.
386 A paragraph, in this case, is a block of text separated above and below
387 by a blank line.
388
389 The margins which JOE uses for paragraph formatting and word-wrap can
390 be set with the ^T L and ^T R commands. If the left margin is set to a
391 value other than 1, then when you start typing at the beginning of a
392 line, the cursor will immediately jump to the left margin.
393
394 If you want to center a line within the margins, use the ^K A command.
395
396
397 Over-type mode
398 Sometimes it's tiresome to have to delete old text before or after you
399 insert new text. This happens, for example, when you are changing a
400 table and you want to maintain the column position of the right side of
401 the table. When this occurs, you can put the editor in over-type mode
402 with ^T T. When the editor is in this mode, the characters you type in
403 replace existing characters, in the way an idealized typewriter would.
404 Also, Backspace simply moves left instead of deleting the character to
405 the left, when it's not at the end or beginning of a line. Over-type
406 mode is not the natural way of dealing with text electronically, so you
407 should go back to insert-mode as soon as possible by typing ^T T again.
408
409 If you need to insert while you're in over-type mode, hit ^@. This
410 inserts a single SPACE into the text.
411
412
413 Control and Meta characters
414 Each character is represented by a number. For example, the number for
415 'A' is 65 and the number for '1' is 49. All of the characters which
416 you normally see have numbers in the range of 32 - 126 (this particular
417 arbitrary assignment between characters and numbers is called the ASCII
418 character set). The numbers outside of this range, from 0 to 255,
419 aren't usually displayed, but sometimes have other special meanings.
420 The number 10, for example, is used for the line-breaks. You can enter
421 these special, non-displayed control characters by first hitting ` and
422 then hitting a character in the range @ A B C ... X Y Z [ ^ ] \ _ to
423 get the number 0 - 31, and ? to get 127. For example, if you hit ` J,
424 you'll insert a line-break character, or if you hit ` I, you'll insert
425 a TAB character (which does the same thing the TAB key does). A useful
426 control character to enter is 12 (` L), which causes most printers to
427 advance to the top of the page. You'll notice that JOE displays this
428 character as an underlined L. You can enter the characters above 127,
429 the meta characters, by first hitting ^\. This adds 128 to the next
430 (possibly control) character entered. JOE displays characters above
431 128 in inverse-video. Some foreign languages, which have more letters
432 than English, use the meta characters for the rest of their alphabet.
433 You have to put the editor in ASIS mode (described later) to have these
434 passed untranslated to the terminal.
435
436
437 Prompts
438 If you hit TAB at any file name prompt, joe will attempt to complete
439 the name you entered as much as possible. If it couldn't complete the
440 entire name, because there are more than one possible completions, joe
441 beeps. If you hit TAB again, joe list the completions. You can use
442 the arrow keys to move around this directory menu and press RETURN or
443 SPACE to select an item. If you press the first letter of one of the
444 directory entries, it will be selected, or if more than one entry has
445 the same first letter, the cursor will jump between those entries. If
446 you select a subdirectory or .., the directory name is appended to the
447 prompt and the new directory is loaded into the menu. You can hit
448 Backspace to go back to the previous directory.
449
450 Most prompts record a history of the responses you give them. You can
451 hit up and down arrow to step through these histories.
452
453 Prompts are actually single line windows with no status line, so you
454 can use any editing command that you normally use on text within the
455 prompts. The prompt history is actually just other lines of the same
456 "prompt file". Thus you can can search backwards though the prompt
457 history with the normal ^K F command if you want.
458
459 Since prompts are windows, you can also switch out of them with ^K P
460 and ^K N.
461
462
463 Where am I?
464 Hit ^K SPACE to have JOE report the line number, column number, and
465 byte number on the last line of the screen. The number associated with
466 the character the cursor is on (its ASCII code) is also shown. You can
467 have the line number and/or column number always displayed on the sta‐
468 tus line by setting placing the appropriate escape sequences in the
469 status line setup strings. Edit the joerc file for details.
470
471
472 File operations
473 You can hit ^K D to save the current file (possibly under a different
474 name from what the file was called originally). After the file is
475 saved, you can hit ^K E to edit a different file.
476
477 If you want to save only a selected section of the file, see the sec‐
478 tion on Blocks below.
479
480 If you want to include another file in the file you're editing, use ^K
481 R to insert it.
482
483
484 Temporarily suspending the editor
485 If you need to temporarily stop the editor and go back to the shell,
486 hit ^K Z. You might want to do this to stop whatever you're editing
487 and answer an e-mail message or read this man page, for example. You
488 have to type fg or exit (you'll be told which when you hit ^K Z) to
489 return to the editor.
490
491
492 Searching for text
493 Hit ^K F to have the editor search forwards or backwards for a text
494 fragment (string) for you. You will be prompted for the text to search
495 for. After you hit Return, you are prompted to enter options. You can
496 just hit Return again to have the editor immediately search forwards
497 for the text, or you can enter one or more of these options:
498
499
500 b Search backwards instead of forwards.
501
502
503 i Treat uppercase and lower case letters as the same when search‐
504 ing. Normally uppercase and lowercase letters are considered to
505 be different.
506
507
508 nnn (where nnn is a number) If you enter a number, JOE searches for
509 the Nth occurrence of the text. This is useful for going to
510 specific places in files structured in some regular manner.
511
512
513 r Replace text. If you enter the r option, then you will be fur‐
514 ther prompted for replacement text. Each time the editor finds
515 the search text, you will be prompted as to whether you want to
516 replace the found search text with the replacement text. You
517 hit: y to replace the text and then find the next occurrence, n
518 to not replace this text, but to then find the next occurrence,
519 r to replace all of the remaining occurrences of the search text
520 in the remainder of the file without asking for confirmation
521 (subject to the nnn option above), or ^C to stop searching and
522 replacing.
523
524
525 You can hit ^L to repeat the previous search.
526
527
528 Regular Expressions
529 A number of special character sequences may be entered as search text:
530
531
532 \* This finds zero or more characters. For example, if you give
533 A\*B as the search text, JOE will try to find an A followed by
534 any number of characters and then a B.
535
536
537 \? This finds exactly one character. For example, if you give A\?B
538 as the search text, JOE will find AXB, but not AB or AXXB.
539
540
541 \^ \$ These match the beginning and end of a line. For example, if
542 you give \^test\$, then JOE with find test on a line by itself.
543
544
545 \< \> These match the beginning and end of a word. For example, if
546 you give \<\*is\*\>, then joe will find whole words which have
547 the sub-string is within them.
548
549
550 \[...] This matches any single character which appears within the
551 brackets. For example, if \[Tt]his is entered as the search
552 string, then JOE finds both This and this. Ranges of characters
553 can be entered within the brackets. For example, \[A-Z] finds
554 any uppercase letter. If the first character given in the
555 brackets is ^, then JOE tries to find any character not given in
556 the the brackets.
557
558
559 \c This works like \*, but matches a balanced C-language expres‐
560 sion. For example, if you search for malloc(\c), then JOE will
561 find all function calls to malloc, even if there was a ) within
562 the parenthesis.
563
564
565 \+ This finds zero or more of the character which immediately fol‐
566 lows the \+. For example, if you give \[ ]\+\[ ], where the
567 characters within the brackets are both SPACE and TAB, then JOE
568 will find whitespace.
569
570
571 \\ Matches a single \.
572
573
574 \n This finds the special end-of-line or line-break character.
575
576
577 A number of special character sequences may also be given in the
578 replacement string:
579
580
581 \& This gets replaced by the text which matched the search string.
582 For example, if the search string was \<\*\>, which matches
583 words, and you give "\&", then joe will put quote marks around
584 words.
585
586
587 \0 - \9
588 These get replaced with the text which matched the Nth \*, \?,
589 \+, \c, \+, or \[...] in the search string.
590
591
592 \\ Use this if you need to put a \ in the replacement string.
593
594
595 \n Use this if you need to put a line-break in the replacement
596 string.
597
598 Some examples:
599
600 Suppose you have a list of addresses, each on a separate line, which
601 starts with "Address:" and has each element separated by commas. Like
602 so:
603
604 Address: S. Holmes, 221b Baker St., London, England
605
606 If you wanted to rearrange the list, to get the country first, then the
607 city, then the person's name, and then the address, you could do this:
608
609 Type ^K F to start the search, and type:
610
611 Address:\*,\*,\*,\*\$
612
613 to match "Address:", the four comma-separated elements, and then the
614 end of the line. When asked for options, you would type r to replace
615 the string, and then type:
616
617 Address:\3,\2,\0,\1
618
619 To shuffle the information the way you want it. After hitting return,
620 the search would begin, and the sample line would be changed to:
621
622 Address: England, London, S. Holmes, 221b Baker St.
623
624
625
626 Blocks
627 If you want to move, copy, save or delete a specific section of text,
628 you can do it with highlighted blocks. First, move the cursor to the
629 start of the section of text you want to work on, and press ^K B. Then
630 move the cursor to the character just after the end of the text you
631 want to affect and press ^K K. The text between the ^K B and ^K K
632 should become highlighted. Now you can move your cursor to someplace
633 else in your document and press ^K M to move the highlighted text
634 there. You can press ^K C to make a copy of the highlighted text and
635 insert it to where the cursor is positioned. ^K Y to deletes the high‐
636 lighted text. ^K W, writes the highlighted text to a file.
637
638 A very useful command is ^K /, which filters a block of text through a
639 unix command. For example, if you select a list of words with ^K B and
640 ^K K, and then type ^K / sort, the list of words will be sorted.
641 Another useful unix command for ^K /, is tr. If you type ^K / tr a-z
642 A-Z, then all of the letters in the highlighted block will be converted
643 to uppercase.
644
645 After you are finished with some block operations, you can just leave
646 the highlighting on if you don't mind it (of course, if you accidently
647 hit ^K Y without noticing...). If it really bothers you, however, just
648 hit ^K B ^K K, to turn the highlighting off.
649
650
651 Indenting program blocks
652 Auto-indent mode toggled with the ^T I command. The joerc is normally
653 set up so that files with names ending with .p, .c or .h have auto-
654 indent mode enabled. When auto-indent mode is enabled and you hit
655 Return, the cursor will be placed in the same column that the first
656 non-SPACE/TAB character was in on the original line.
657
658 You can use the ^K , and ^K . commands to shift a block of text to the
659 left or right. If no highlighting is set when you give these commands,
660 the program block the cursor is located in will be selected, and will
661 be moved by subsequent ^K , and ^K . commands. The number of columns
662 these commands shift by can be set through a ^T option.
663
664
665 Windows
666 You can edit more than one file at the same time or edit two or more
667 different places of the same file. To do this, hit ^K O, to split the
668 screen into two windows. Use ^K P or ^K N to move the cursor into the
669 top window or the lower window. Use ^K E to edit a new file in one of
670 the windows. A window will go away when you save the file with ^K X or
671 abort the file with ^C. If you abort a file which exists in two win‐
672 dows, one of the window goes away, not the file.
673
674 You can hit ^K O within a window to create even more windows. If you
675 have too many windows on the screen, but you don't want to eliminate
676 them, you can hit ^K I. This will show only the window the cursor is
677 in, or if there was only one window on the screen to begin with, try to
678 fit all hidden windows on the screen. If there are more windows than
679 can fit on the screen, you can hit ^K N on the bottom-most window or ^K
680 P on the top-most window to get to them.
681
682 If you gave more than one file name to JOE on the command line, each
683 file will be placed in a different window.
684
685 You can change the height of the windows with the ^K G and ^K T com‐
686 mands.
687
688
689 Keyboard macros
690 Macros allow you to record a series of keystrokes and replay them with
691 the press of two keys. This is useful to automate repetitive tasks.
692 To start a macro recording, hit ^K [ followed by a number from 0 to 9.
693 The status line will display (Macro n recording...). Now, type in the
694 series of keystrokes that you want to be able to repeat. The commands
695 you type will have their usual effect. Hit ^K ] to stop recording the
696 macro. Hit ^K followed by the number you recorded the macro in to exe‐
697 cute one iteration of the key-strokes.
698
699 For example, if you want to put "**" in front of a number of lines, you
700 can type:
701
702 ^K [ ^A ** <down arrow> ^K ]
703
704 Which starts the macro recording, moves the cursor to the beginning of
705 the line, inserts "**", moves the cursor down one line, and then ends
706 the recording. Since we included the key-strokes needed to position the
707 cursor on the next line, we can repeatedly use this macro without hav‐
708 ing to move the cursor ourselves, something you should always keep in
709 mind when recording a macro.
710
711 If you find that the macro you are recording itself has a repeated set
712 of key-strokes in it, you can record a macro within the macro, as long
713 as you use a different macro number. Also you can execute previously
714 recorded macros from within new macros.
715
716
717
718 Repeat
719 You can use the repeat command, ^K \, to repeat a macro, or any other
720 edit command or even a normal character, a specified number of times.
721 Hit ^K \, type in the number of times you want the command repeated and
722 press Return. The next edit command you now give will be repeated that
723 many times.
724
725 For example, to delete the next 20 lines of text, type:
726
727 ^K 20<return>^Y
728
729
730 Rectangle mode
731 Type ^T X to have ^K B and ^K K select rectangular blocks instead of
732 stream-of-text blocks. This mode is useful for moving, copying, delet‐
733 ing or saving columns of text. You can also filter columns of text
734 with the ^K / command- if you want to sort a column, for example. The
735 insert file command, ^K R is also effected.
736
737 When rectangle mode is selected, over-type mode is also useful (^T T).
738 When over-type mode is selected, rectangles will replace existing text
739 instead of getting inserted before it. Also the delete block command
740 (^K Y) will clear the selected rectangle with SPACEs and TABs instead
741 of deleting it. Over-type mode is especially useful for the filter
742 block command (^K /), since it will maintain the original width of the
743 selected column.
744
745
746 Tag search
747 If you are editing a large C program with many source files, you can
748 use the ctags program to generate a tags file. This file contains a
749 list of program symbols and the files and positions where the symbols
750 are defined. The ^K ; command can be used to lookup a symbol (func‐
751 tions, defined constants, etc.), load the file where the symbol is
752 defined into the current window and position the cursor to where the
753 symbol is defined. ^K ; prompts you for the symbol you want, but uses
754 the symbol the cursor was on as a default. Since ^K ; loads the defi‐
755 nition file into the current window, you probably want to split the
756 window first with ^K O, to have both the original file and the defini‐
757 tion file loaded.
758
759
760 Shell windows
761 Hit ^K ' to run a command shell in one of JOE's windows. When the cur‐
762 sor is at the end of a shell window (use ^K V if it's not), whatever
763 you type is passed to the shell instead of the window. Any output from
764 the shell or from commands executed in the shell is appended to the
765 shell window (the cursor will follow this output if it's at the end of
766 the shell window). This command is useful for recording the results of
767 shell commands- for example the output of make, the result of grepping
768 a set of files for a string, or directory listings from FTP sessions.
769 Besides typeable characters, the keys ^C, Backspace, DEL, Return and ^D
770 are passed to the shell. Type the shell exit command to stop recording
771 shell output. If you press ^C in a shell window, when the cursor is
772 not at the end of the window, the shell is killed.
773
774
776 For JOE to operate correctly, a number of other environment settings
777 must be correct. The throughput (baud rate) of the connection between
778 the computer and your terminal must be set correctly for JOE to update
779 the screen smoothly and allow typeahead to defer the screen update.
780 Use the stty nnn command to set this. You want to set it as close as
781 possible to actual throughput of the connection. For example, if you
782 are connected via a 1200 baud modem, you want to use this value for
783 stty. If you are connected via 14.4k modem, but the terminal server
784 you are connected to connects to the computer a 9600 baud, you want to
785 set your speed as 9600 baud. The special baud rate of 38400 or extb is
786 used to indicate that you have a very-high speed connection, such as a
787 memory mapped console or an X-window terminal emulator. If you can't
788 use stty to set the actual throughput (perhaps because of a modem com‐
789 municating with the computer at a different rate than it's communicat‐
790 ing over the phone line), you can put a numeric value in the BAUD envi‐
791 ronment variable instead (use setenv BAUD 9600 for csh or BAUD=9600;
792 export BAUD for sh).
793
794 The TERM environment variable must be set to the type of terminal
795 you're using. If the size (number of lines/columns) of your terminal
796 is different from what is reported in the TERMCAP or TERMINFO entry,
797 you can set this with the stty rows nn cols nn command, or by setting
798 the LINES and COLUMNS environment variables.
799
800 JOE normally expects that flow control between the computer and your
801 terminal to use ^S/^Q handshaking (I.E., if the computer is sending
802 characters too fast for your terminal, your terminal sends ^S to stop
803 the output and ^Q to restart it). If the flow control uses out-of-band
804 or hardware handshaking or if your terminal is fast enough to always
805 keep up with the computer output and you wish to map ^S/^Q to edit com‐
806 mands, you can set the environment variable NOXON to have JOE attempt
807 to turn off ^S/^Q handshaking. If the connection between the computer
808 and your terminal uses no handshaking and your terminal is not fast
809 enough to keep up with the output of the computer, you can set the
810 environment variable DOPADDING to have JOE slow down the output by
811 interspersing PAD characters between the terminal screen update
812 sequences.
813
814
816 Wherever JOE expects you to enter a file name, whether on the command
817 line or in prompts within the editor, you may also type:
818
819
820 !command
821 Read or write data to or from a shell command. For example, use
822 joe '!ls' to get a copy of your directory listing to edit or
823 from within the editor use ^K D !mail jhallen@world.std.com to
824 send the file being edited to me.
825
826
827 >>filename
828 Use this to have JOE append the edited text to the end of the
829 file "filename."
830
831
832 filename,START,SIZE
833 Use this to access a fixed section of a file or device. START
834 and SIZE may be entered in decimal (ex.: 123) octal (ex.: 0777)
835 or hexadecimal (ex.: 0xFF). For example, use joe /dev/fd0,508,2
836 to edit bytes 508 and 509 of the first floppy drive in Linux.
837
838
839 - Use this to get input from the standard input or to write output
840 to the standard output. For example, you can put joe in a pipe
841 of commands: quota -v | joe - | mail root, if you want to com‐
842 plain about your low quota.
843
844
845
847 ^T options, the help screens and the key-sequence to editor command
848 bindings are all defined in JOE's initialization file. If you make a
849 copy of this file (which normally resides in /etc/joe/joerc) to
850 $HOME/.joerc, you can customize these setting to your liking. The syn‐
851 tax of the initialization file should be fairly obvious and there are
852 further instruction in it.
853
854
856 JOE was written by Joseph H. Allen. If you have bug reports or ques‐
857 tions, e-mail them to jhallen@world.std.com. Larry Foard
858 (entropy@world.std.com) and Gary Gray (ggray@world.std.com) also helped
859 with the creation of JOE.
860
861
862
863 JOE(1)