1JOE(1)                      General Commands Manual                     JOE(1)
2
3
4

NAME

6       joe - Joe's Own Editor
7

SYNTAX

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
19       jupp [global-options] [ [local-options] filename ]...
20

DESCRIPTION

22       JOE  is a powerful ASCII text screen editor.  It has a "mode-less" user
23       interface which is similar to many user-friendly PC editors.  Users  of
24       Micro-Pro's  WordStar or Borland's "Turbo" languages will feel at home.
25       JOE is a full featured UNIX screen editor though, and has many features
26       for editing programs and text.
27
28       JOE also emulates several other editors.  JSTAR is a close imitation of
29       WordStar with many "JOE" extensions.  JPICO is a close imitation of the
30       Pine  mailing  system's  PICO  editor,  but  with  many  extensions and
31       improvements.  JMACS is a GNU EMACS imitation.  RJOE  is  a  restricted
32       version  of  JOE,  which allows you to edit only the files specified on
33       the command line.
34
35       Although JOE is actually six different editors, it still requires  only
36       one executable, but one with six different names.  The name of the edi‐
37       tor with an "rc" appended gives the name of JOE's initialisation  file,
38       which determines the personality of the editor.
39
40       JUPP is free software; you can distribute it and/or modify it under the
41       terms of the GNU General Public License, Version 1, as published by the
42       Free  Software  Foundation.   See main.c (contains more detailed excep‐
43       tions).  I have no plans for turning JOE into a commercial or shareware
44       product.   Check  the  source  code  for exact authorship and licencing
45       information.  JOE is available over the Internet  from  http://joe-edi
46       tor.sf.net/.  JUPP is available at http://mirbsd.de/jupp.
47
48

USAGE

50       To  start  the editor, type joe followed by zero or more names of files
51       you want to edit.  Each file name may be preceded  by  a  local  option
52       setting  (see  the  local  options  table which follows).  Other global
53       options, which apply to the editor as a whole, may also  be  placed  on
54       the  command line (see the global options table which follows).  If you
55       are editing a new file, you can either give the name of  the  new  file
56       when  you  invoke  the  editor,  or in the editor when you save the new
57       file.  A modified syntax for file names is provided  to  allow  you  to
58       edit  program  output,  standard  input/output, or sections of files or
59       devices.  See the section Filenames below for details.
60
61       On cygwin32 systems, the special option -CYGhack is  replaced  by  any‐
62       thing  that  comes  past  it (and separating whitespace) on the command
63       line as one option (to work around a Cygwin bug as it cannot  correctly
64       be  passed  a UNC pathname with spaces as one argument from Explorer at
65       all).
66
67       Once you are in the editor, you can type in text and use  special  con‐
68       trol  character  sequences to perform other editing tasks.  To find out
69       what the control character sequences are, read the  rest  of  this  man
70       page or type ^K H for help in the editor.
71
72       Now for some obscure computer lore:
73
74       The  ^ means that you hold down the Control key while pressing the fol‐
75       lowing key (the same way the Shift key works for uppercase letters).  A
76       number  of  control key sequences are duplicated on other keys, so that
77       you don't need to press the control key: ESC will work in place of  ^[,
78       Del  will  work in place of ^?, Backspace will work in place of ^H, Tab
79       will work in place of ^I, Return or Enter will work in place of ^M  and
80       Linefeed will work in place of ^J.  Some keyboards may give you trouble
81       with some control keys.  ^_, ^^ and ^@ can usually be  entered  without
82       pressing shift (I.E., try ^-, ^6 and ^2).  Other keyboards may reassign
83       these to other keys.  Try: ^., ^, and ^/.  ^SPACE can usually  be  used
84       in  place  of ^@.  ^\ and ^] are interpreted by many communication pro‐
85       grams, including telnet and kermit.  Usually you just hit the key twice
86       to get it to pass through the communication program.
87
88       Once  you  have typed ^K H, the first help window appears at the top of
89       the screen.  You can continue to enter and edit  text  while  the  help
90       window  is on.  To page through other topics, hit ^[, and ^[. (that is,
91       ESC , and ESC .).  Use ^K H to dismiss the help window.
92
93       You can customise the keyboard layout, the help screens and a number of
94       behavior   defaults  by  copying  JOE's  initialisation  file  (usually
95       /etc/jupp/joe/joerc) to .joerc in your home directory and then by modi‐
96       fying  it.   See  the  section  joerc  below.  The filename is actually
97       .namerc where name is the argv[0] the editor is called with.
98
99       Custom syntax files are loaded from .jupp/syntax/name.jsf in your  home
100       directory  and  .jupp/charmaps/name holds custom charmaps (name here is
101       the name of the syntax or charmap).
102
103       To have JOE used as your default editor for eMail and News, you need to
104       set the EDITOR and VISUAL environment variables in your shell initiali‐
105       sation file (.cshrc or .profile) to refer to JOE (the joe  binary  usu‐
106       ally resides as /usr/bin/joe).
107
108       There  are  a  number  of other obscure invocation parameters which may
109       have to be set, particularly if your terminal screen is not updating as
110       you think it should.  See the section Environment variables below.
111
112

COMMAND LINE OPTIONS

114       The following global options may be specified on the command line:
115
116
117       -asis  Characters with codes above 127 will be sent to the terminal as-
118              is, instead of as inverse of the corresponding  character  below
119              128.  If this does not work, check your terminal server.
120
121
122       -backpath path
123              If  this  option  is  given,  backup files will be stored in the
124              specified directory instead of in each  file's  original  direc‐
125              tory.
126
127
128       -baud nnn
129              Set  the baud rate for the purposes of terminal screen optimisa‐
130              tion.  Joe inserts delays for  baud  rates  below  19200,  which
131              bypasses  tty  buffering  so  that  typeahead will interrupt the
132              screen output.  Scrolling commands will not be  used  for  38400
133              baud.   This  is useful for X-Window terminals and other console
134              ttys which really aren't going over a serial line.
135
136
137       -beep  Joe will beep on command errors and when the  cursor  goes  past
138              extremes.
139
140
141       -columns nnn
142              Sets the number of screen columns.
143
144
145       -csmode
146              Continued  search  mode: a search immediately following a search
147              will repeat the previous search instead  of  prompting  for  new
148              string.  This is useful for the the ^[S and ^[R commands and for
149              when joe is trying to be emacs.
150
151
152       -dopadding
153              Joe usually assumes that there is  some  kind  of  flow  control
154              between  it  and the tty.  If there isn't, this option will make
155              joe output extra ^@s to the tty  as  specified  by  the  termcap
156              entry.   The extra ^@s allow the terminal to catch up after long
157              terminal commands.
158
159
160       -exask This option makes ^KX verify the file name that  it's  about  to
161              write.
162
163
164       -force This option makes sure that the last line of the file has a line
165              feed when it is saved.
166
167
168       -help  The editor will start with the help screen on if this option  is
169              given.
170
171
172       -keepup
173              Normally  the column number and control-key prefix fields of the
174              status lines are on a one second delay to  reduce  CPU  consump‐
175              tion,  but  with  this  option  they are updated after each key‐
176              stroke.
177
178
179       -lightoff
180              The block highlighting will go away after any block  command  if
181              this option is given.
182
183
184       -lines nnn
185              Sets the number of screen lines.
186
187
188       -marking
189              Text  between  ^KB  and  the  cursor  is  highlighted  (use with
190              -lightoff and a modified joerc file to  have  drop-anchor  style
191              block selection).
192
193
194       -mid   If  this  option is set and the cursor moves off the window, the
195              window will be scrolled so that the cursor  is  in  the  center.
196              This  option  is  forced  on  slow  terminals  which  don't have
197              scrolling commands.
198
199
200       -nobackups
201              This option prevents backup files.
202
203
204       -nonotice
205              This option prevent the copyright notice  from  being  displayed
206              when the editor starts.
207
208
209       -nosta This  option  eliminates the topmost status line.  It's nice for
210              when you only want to see your text on the screen or  if  you're
211              using a vt52.
212
213
214       -noxon Attempt  to  turn off ^S/^Q processing.  This is useful for when
215              joe is trying to be WordStar or EMACS.
216
217
218       -orphan
219              When this option is active, extra files on the command line will
220              be placed in orphaned buffers instead of in extra windows.  This
221              is useful for when joe is trying to be emacs.
222
223
224       -pg nnn
225              This specifies the number  of  lines  to  keep  after  PgUp/PgDn
226              (^U/^V).  If -1 is given, half the window is kept.
227
228
229       -skiptop nnn
230              Don't  use the top nnn lines of the screen.  Useful for when joe
231              is used as a BBS editor.
232
233
234       Each of these options may be specified in the joerc file as  well.   In
235       addition,  the NOXON, BAUD, LINES, COLUMNS and DOPADDING options may be
236       specified with environment  variables.   See  the  section  Environment
237       variables below.
238
239       The following options may be specified before each filename on the com‐
240       mand line:
241
242
243       +nnn   The cursor starts on the specified line.
244
245
246       -crlf  Joe uses CR-LF as the end of line sequence instead of  just  LF.
247              This is for editing MS-DOS or VMS files.
248
249
250       -hex   Sets the buffer to hex edit mode.
251
252
253       -wordwrap
254              Joe wraps the previous word when you type past the right margin.
255
256
257       -autoindent
258              When  you  hit  Return  on  an indented line, the indentation is
259              duplicated onto the new line.
260
261
262       -overwrite
263              Typing  overwrites  existing  characters  instead  of  inserting
264              before them.
265
266
267       -lmargin nnn
268              Sets the left margin.
269
270
271       -rmargin nnn
272              Sets the right margin.
273
274
275       -tab nnn
276              Sets the tab width.
277
278
279       -indentc nnn
280              Sets  the indentation character for ^K, and ^K. (32 for SPACE, 9
281              for TAB).
282
283
284       -istep nnn
285              Sets the indentation step for ^K, and ^K..
286
287
288       -linums
289              Line numbers are displayed before each line.
290
291
292       -rdonly
293              The file is read only.
294
295
296       -keymap name
297              Use an alternate section of the joerc file for the key  sequence
298              bindings.   For  example,  joe,  jstar,  rjoe  and  jupp support
299              -keymap cua to make ^Z, ^X, ^C and ^V do the same  thing  as  in
300              contemporary GUI editors.
301
302
303       These options can also be specified in the joerc file.  They can be set
304       depending on the filename extension.  Programs (.c, .h or .p extension)
305       usually  have  autoindent enabled.  Wordwrap is enabled on other files,
306       but rc files have it disabled.
307
308

EDITING TASKS

310   Basic Editing
311       When you type characters into the editor, they  are  normally  inserted
312       into the file being edited (or appended to the file if the cursor is at
313       the end of the file).  This is the normal operating mode of the editor.
314       If  you  want to replace some existing text, you have to delete the old
315       text before or after you type in the replacement text.   The  Backspace
316       key  can  be used for deleting text: move the cursor to right after the
317       text you want to delete and hit Backspace a number of times.
318
319       Hit the Enter or Return key to insert a line break.   For  example,  if
320       the  cursor  was  in  the middle of a line and you hit Return, the line
321       would be split into two lines with the cursor appearing at  the  begin‐
322       ning  of  the second line.  Hit Backspace at the beginning of a line to
323       eliminate a line break.
324
325       Use the arrow keys to move around the file.  If your  keyboard  doesn't
326       have arrow keys (or if they don't work for some reason), use ^F to move
327       forwards (right), ^B to move backwards (left), ^P to move to the previ‐
328       ous  line  (up), and ^N to move to the next line (down).  The right and
329       left arrow keys simply move forwards or backwards one  character  at  a
330       time  through  the  text:  if you're at the beginning of a line and you
331       press left-arrow, you will end up at the end of the previous line.  The
332       up and down arrow keys move forwards and backwards by enough characters
333       so that the cursor appears in the same column that it  was  in  on  the
334       original line.
335
336       If  you  want  to  indent  the text you enter, you can use the TAB key.
337       This inserts a special control character  which  makes  the  characters
338       which  follow  it begin at the next TAB STOP.  TAB STOPS normally occur
339       every 8 columns, but this can be changed with the ^T D command.  Python
340       programmers often set TAB STOPS on every 4 columns.
341
342       If for some reason your terminal screen gets messed up (for example, if
343       you receive a mail notice from biff), you can have the  editor  refresh
344       the screen by hitting ^R.
345
346       There are many other keys for deleting text and moving around the file.
347       For example, hit ^D to delete the character the cursor is on instead of
348       deleting backwards like Backspace.  ^D will also delete a line break if
349       the cursor is at the end of a line.  Type ^Y to delete the entire  line
350       the cursor is on or ^J to delete just from the cursor to the end of the
351       line.
352
353       Hit ^A to move the cursor to the beginning of the line it's on.  Hit ^E
354       to  move the cursor to the end of the line.  Hit ^U or ^V for scrolling
355       the cursor up or down 1/2 a screen's worth.  "Scrolling" means that the
356       text  on the screen moves, but the cursor stays at the same place rela‐
357       tive to the screen.  Hit ^K U or ^K V to move the cursor to the  begin‐
358       ning or the end of the file.  Look at the help screens in the editor to
359       find even more delete and movement commands.
360
361       If you make a mistake, you can hit ^_ to "undo" it.  On most  keyboards
362       you  hit just ^- to get ^_, but on some you might have to hold both the
363       Shift and Control keys down at the same time to get it.  If you  "undo"
364       too  much, you can "redo" the changes back into existence by hitting ^^
365       (type this with just ^6 on most keyboards).
366
367       If you were editing in one place within the file, and you  then  tempo‐
368       rarily  had  to  look or edit some other place within the file, you can
369       get back to the original place by hitting ^K-.  This  command  actually
370       returns  you  to the last place you made a change in the file.  You can
371       step through a history of places with ^K- and ^K =, in the same way you
372       can step through the history of changes with the "undo" and "redo" com‐
373       mands.
374
375       When you are done editing the file, hit ^K X to exit the  editor.   You
376       will  be  prompted for a file name if you hadn't already named the file
377       you were editing.
378
379       When you edit a file, you actually edit only a copy of the file.  So if
380       you  decide that you don't want the changes you made to a file during a
381       particular edit session, you can hit ^C to exit the editor without sav‐
382       ing them.
383
384       If  you  edit a file and save the changes, a "backup" copy of that file
385       is created in the current directory, with a ~  appended  to  the  name,
386       which contains the original version of the file.
387
388
389   Word wrap and formatting
390       If you type past the right edge of the screen in a C language or PASCAL
391       file, the screen will scroll to the right to follow the cursor.  If you
392       type past the right edge of the screen in a normal file (one whose name
393       doesn't end in .c, .h or .p), JOE will automatically wrap the last word
394       onto  the  next  line  so  that  you don't have to hit Return.  This is
395       called word-wrap mode.  Word-wrap can be turned on or off with the ^T W
396       command.  JOE's initialisation file is usually set up so that this mode
397       is automatically turned on for all non-program files.  See the  section
398       below on the joerc file to change this and other defaults.
399
400       Aside  for  Word-wrap  mode, JOE does not automatically keep paragraphs
401       formatted like some word processors.  Instead, if you need a  paragraph
402       to  be  reformatted,  hit  ^K J.  This command "fills in" the paragraph
403       that the cursor is in, fitting as many words in a line as is  possible.
404       A paragraph, in this case, is a block of text separated above and below
405       by a blank line or a line beginning with a period (".").  Lines can  be
406       indented  by  tab,  any  of the !#$%&)*+,-./:;=>?@\]^_|}~ characters or
407       spaces.
408
409       The margins which JOE uses for paragraph formatting and  word-wrap  can
410       be set with the ^T L and ^T R commands.  If the left margin is set to a
411       value other than 1, then when you start typing at the  beginning  of  a
412       line, the cursor will immediately jump to the left margin.
413
414       If you want to center a line within the margins, use the ^K A command.
415
416
417   Overtype mode
418       Sometimes  it's tiresome to have to delete old text before or after you
419       insert new text.  This happens, for example, when you  are  changing  a
420       table and you want to maintain the column position of the right side of
421       the table.  When this occurs, you can put the editor in  overtype  mode
422       with ^T T.  When the editor is in this mode, the characters you type in
423       replace existing characters, in the way an idealised typewriter  would.
424       Additionally, Backspace simply moves left instead of deleting the char‐
425       acter to the left, when it's not at the end or  beginning  of  a  line.
426       Overtype  mode  is  not the natural way of dealing with text electroni‐
427       cally, so you should go back to insert mode as soon as possible by typ‐
428       ing ^T T again.
429
430       If  you  need  to  insert  while you're in overtype mode, hit ^@.  This
431       inserts a single SPACE into the text.
432
433
434   Control and Meta characters
435       Each character is represented by a number.  For example, the number for
436       'A'  is  65  and the number for '1' is 49.  All of the characters which
437       you normally see have numbers in the range of 32 to 126 (this  particu‐
438       lar  arbitrary  assignment between characters and numbers is called the
439       ASCII  character  set).   The  numbers  outside  of  this  range,  from
440       0 to 255,  aren't  usually  displayed, but sometimes have other special
441       meanings.  The number 10, for example, is used  for  the  line  breaks.
442       You  can enter these special, non-displayed control characters by first
443       hitting ` and then hitting a character in the range @ A B C ... X Y Z [
444       ^  ]  \ _ to get the number 0 to 31, and ? to get 127.  For example, if
445       you hit ` J, you'll insert a line break character, or if you  hit  ` I,
446       you'll  insert  a  TAB character (which does the same thing the TAB key
447       does).  A useful control character to enter is 12 (` L),  which  causes
448       most  printers  to  advance to the top of the page.  You'll notice that
449       JOE displays this character as an underlined  L.   You  can  enter  the
450       characters  above  127, the meta characters, by first hitting ^\.  This
451       adds 128 to the next (possibly control) character  entered.   JOE  dis‐
452       plays  characters  above 128 in inverse video.  Some foreign languages,
453       which have more letters than English, use the meta characters  for  the
454       rest  of  their  alphabet.   You  have  to put the editor in as-is mode
455       (described later) to have these passed untranslated to the terminal.
456
457
458   Prompts
459       If you hit TAB at any file name prompt, joe will  attempt  to  complete
460       the  name you entered as much as possible.  If it couldn't complete the
461       entire name, because there are more than one possible completions,  joe
462       beeps.   If  you  hit TAB again, joe list the completions.  You can use
463       the arrow keys to move around this directory menu and press  RETURN  or
464       SPACE  to  select an item.  If you press the first letter of one of the
465       directory entries, it will be selected, or if more than one  entry  has
466       the  same first letter, the cursor will jump between those entries.  If
467       you select a subdirectory or .., the directory name is appended to  the
468       prompt  and  the  new  directory  is loaded into the menu.  You can hit
469       Backspace to go back to the previous directory.
470
471       Most prompts record a history of the responses you give them.  You  can
472       hit up and down arrow to step through these histories.
473
474       Prompts  are  actually  single line windows with no status line, so you
475       can use any editing command that you normally use on  text  within  the
476       prompts.   The  prompt history is actually just other lines of the same
477       "prompt file".  Thus you can can search  backwards  though  the  prompt
478       history with the normal ^K F command if you want.
479
480       Since  prompts  are  windows, you can also switch out of them with ^K P
481       and ^K N.
482
483
484   Where am I?
485       Hit ^K SPACE to have JOE report the line  number,  column  number,  and
486       byte number on the last line of the screen.  The number associated with
487       the character the cursor is on (its ASCII code) is also shown.  You can
488       have  the line number and/or column number always displayed on the sta‐
489       tus line by setting placing the appropriate  escape  sequences  in  the
490       status line setup strings.  Edit the joerc file for details.
491
492
493   File operations
494       You  can  hit ^K D to save the current file (possibly under a different
495       name from what the file was called  originally).   After  the  file  is
496       saved, you can hit ^K E to edit a different file.
497
498       If  you  want to save only a selected section of the file, see the sec‐
499       tion on Blocks below.
500
501       If you want to include another file in the file you're editing, use  ^K
502       R to insert it.
503
504
505   Temporarily suspending the editor
506       If  you  need  to temporarily stop the editor and go back to the shell,
507       hit ^K Z.  You might want to do this to stop  whatever  you're  editing
508       and  answer  an  eMail message or read this man page, for example.  You
509       have to type fg or exit (you'll be told which when you  hit  ^K  Z)  to
510       return to the editor.
511
512
513   Searching for text
514       Hit  ^K  F  to  have the editor search forwards or backwards for a text
515       fragment (string) for you.  You will be prompted for the text to search
516       for.  After you hit Return, you are prompted to enter options.  You can
517       just hit Return again to have the editor  immediately  search  forwards
518       for the text, or you can enter one or more of these options:
519
520
521       b      Search backwards instead of forwards.
522
523
524       i      Treat  uppercase and lower case letters as the same when search‐
525              ing.  Normally uppercase and lowercase letters are considered to
526              be different.
527
528
529       nnn    (where  nnn is a number) If you enter a number, JOE searches for
530              the Nth occurrence of the text.  This is  useful  for  going  to
531              specific places in files structured in some regular manner.
532
533
534       r      Replace  text.  If you enter the r option, then you will be fur‐
535              ther prompted for replacement text.  Each time the editor  finds
536              the  search text, you will be prompted as to whether you want to
537              replace the found search text with the  replacement  text.   You
538              hit:  y to replace the text and then find the next occurrence, n
539              to not replace this text, but to then find the next  occurrence,
540              l  to replace the text and then stop searching, r to replace all
541              of the remaining occurrences of the search text in the remainder
542              of  the file without asking for confirmation (subject to the nnn
543              option above), or ^C to stop searching and replacing.
544
545
546       You can hit ^L to repeat the previous search.
547
548
549   Regular Expressions
550       A number of special character sequences may be entered as search text:
551
552
553       \*     This finds zero or more characters.  For example,  if  you  give
554              A\*B  as  the search text, JOE will try to find an A followed by
555              any number of characters and then a B.
556
557
558       \?     This finds exactly one character.  For example, if you give A\?B
559              as the search text, JOE will find AXB, but not AB or AXXB.
560
561
562       \^ \$  These  match  the  beginning and end of a line.  For example, if
563              you give \^test\$, then JOE with find test on a line by itself.
564
565
566       \< \>  These match the beginning and end of a word.   For  example,  if
567              you  give  \<\*is\*\>, then joe will find whole words which have
568              the substring is within them.
569
570
571       \[...] This matches any  single  character  which  appears  within  the
572              brackets.   For  example,  if  \[Tt]his is entered as the search
573              string, then JOE finds both This and this.  Ranges of characters
574              can  be  entered within the brackets.  For example, \[A-Z] finds
575              any uppercase letter.  If  the  first  character  given  in  the
576              brackets is ^, then JOE tries to find any character not given in
577              the the brackets.
578
579
580       \c     This works like \*, but matches a  balanced  C-language  expres‐
581              sion.   For example, if you search for malloc(\c), then JOE will
582              find all function calls to malloc, even if there was a )  within
583              the parenthesis.
584
585
586       \+     This  finds zero or more of the character which immediately fol‐
587              lows the \+.  For example, if you give \[  ]\+\[  ],  where  the
588              characters  within the brackets are both SPACE and TAB, then JOE
589              will find whitespace.
590
591
592       \\     Matches a single \.
593
594
595       \n     This finds the special end-of-line or line-break character.
596
597
598       A number of special character  sequences  may  also  be  given  in  the
599       replacement string:
600
601
602       \&     This  gets replaced by the text which matched the search string.
603              For example, if the search  string  was  \<\*\>,  which  matches
604              words,  and  you give "\&", then joe will put quote marks around
605              words.
606
607
608       \0 - \9
609              These get replaced with the text which matched the Nth  \*,  \?,
610              \+, \c, \+, or \[...] in the search string.
611
612
613       \\     Use this if you need to put a \ in the replacement string.
614
615
616       \n     Use  this  if  you  need  to put a line break in the replacement
617              string.
618
619       Some examples:
620
621       Suppose you have a list of addresses, each on a  separate  line,  which
622       starts  with "Address:" and has each element separated by commas.  Like
623       so:
624
625       Address: S. Holmes, 221b Baker St., London, England
626
627       If you wanted to rearrange the list, to get the country first, then the
628       city, then the person's name, and then the address, you could do this:
629
630       Type ^K F to start the search, and type:
631
632       Address:\*,\*,\*,\*\$
633
634       to  match  "Address:",  the four comma-separated elements, and then the
635       end of the line.  When asked for options, you would type r  to  replace
636       the string, and then type:
637
638       Address:\3,\2,\0,\1
639
640       To  shuffle  the information the way you want it. After hitting return,
641       the search would begin, and the sample line would be changed to:
642
643       Address: England, London, S. Holmes, 221b Baker St.
644
645
646
647   Blocks
648       If you want to move, copy, save or delete a specific section  of  text,
649       you  can  do it with highlighted blocks.  First, move the cursor to the
650       start of the section of text you want to work on, and press ^K B.  Then
651       move  the  cursor  to  the character just after the end of the text you
652       want to affect and press ^K K.  The text between the  ^K  B  and  ^K  K
653       should  become  highlighted.  Now you can move your cursor to someplace
654       else in your document and press ^K  M  to  move  the  highlighted  text
655       there.   You  can press ^K C to make a copy of the highlighted text and
656       insert it to where the cursor is positioned.  ^K Y to deletes the high‐
657       lighted text.  ^K W, writes the highlighted text to a file.
658
659       A  very useful command is ^K /, which filters a block of text through a
660       unix command.  For example, if you select a list of words with ^K B and
661       ^K  K,  and  then  type  ^K  /  sort, the list of words will be sorted.
662       Another useful unix command for ^K /, is tr.  If you type ^K /  tr  a-z
663       A-Z, then all of the letters in the highlighted block will be converted
664       to uppercase.
665
666       After you are finished with some block operations, you can  just  leave
667       the  highlighting  on  if you don't mind it (of course, if you acciden‐
668       tally hit ^K Y without noticing...).  If it really  bothers  you,  how‐
669       ever, just hit ^K B ^K K, to turn the highlighting off.
670
671
672   Indenting program blocks
673       Auto-indent  mode toggled with the ^T I command.  The joerc is normally
674       set up so that files with names ending with .p, .c  or  .h  have  auto-
675       indent  mode  enabled.   When  auto-indent  mode is enabled and you hit
676       Return, the cursor will be placed in the same  column  that  the  first
677       non-SPACE/TAB character was in on the original line.
678
679       You  can use the ^K , and ^K . commands to shift a block of text to the
680       left or right.  If no highlighting is set when you give these commands,
681       the  program  block the cursor is located in will be selected, and will
682       be moved by subsequent ^K , and ^K . commands.  The number  of  columns
683       these commands shift by can be set through a ^T option.
684
685
686   Windows
687       You  can  edit  more than one file at the same time or edit two or more
688       different places of the same file.  To do this, hit ^K O, to split  the
689       screen  into two windows.  Use ^K P or ^K N to move the cursor into the
690       top window or the lower window.  Use ^K E to edit a new file in one  of
691       the windows.  A window will go away when you save the file with ^K X or
692       abort the file with ^C.  If you abort a file which exists in  two  win‐
693       dows, one of the window goes away, not the file.
694
695       You  can  hit ^K O within a window to create even more windows.  If you
696       have too many windows on the screen, but you don't  want  to  eliminate
697       them,  you  can hit ^K I.  This will show only the window the cursor is
698       in, or if there was only one window on the screen to begin with, try to
699       fit  all  hidden windows on the screen.  If there are more windows than
700       can fit on the screen, you can hit ^K N on the bottom-most window or ^K
701       P on the top-most window to get to them.
702
703       If  you  gave  more than one file name to JOE on the command line, each
704       file will be placed in a different window.
705
706       You can change the height of the windows with the ^K G and  ^K  T  com‐
707       mands.
708
709
710   Keyboard macros
711       Macros  allow you to record a series of keystrokes and replay them with
712       the press of two keys.  This is useful to  automate  repetitive  tasks.
713       To  start a macro recording, hit ^K [ followed by a number from 0 to 9.
714       The status line will display (Macro n recording...).  Now, type in  the
715       series  of keystrokes that you want to be able to repeat.  The commands
716       you type will have their usual effect.  Hit ^K ] to stop recording  the
717       macro.  Hit ^K followed by the number you recorded the macro in to exe‐
718       cute one iteration of the keystrokes.
719
720       For example, if you want to put "**" in front of a number of lines, you
721       can type:
722
723       ^K [ ^A ** <down arrow> ^K ]
724
725       Which  starts the macro recording, moves the cursor to the beginning of
726       the line, inserts "**", moves the cursor down one line, and  then  ends
727       the recording.  Since we included the keystrokes needed to position the
728       cursor on the next line, we can repeatedly use this macro without  hav‐
729       ing  to  move the cursor ourselves, something you should always keep in
730       mind when recording a macro.
731
732       If you find that the macro you are recording itself has a repeated  set
733       of  keystrokes  in it, you can record a macro within the macro, as long
734       as you use a different macro number.  Also you can  execute  previously
735       recorded macros from within new macros.
736
737
738
739   Repeat
740       You  can  use the repeat command, ^K \, to repeat a macro, or any other
741       edit command or even a normal character, a specified number  of  times.
742       Hit ^K \, type in the number of times you want the command repeated and
743       press Return.  The next edit command you now give will be repeated that
744       many times.
745
746       For example, to delete the next 20 lines of text, type:
747
748       ^K  20<return>^Y
749
750
751   Rectangle mode
752       Type  ^T  X  to have ^K B and ^K K select rectangular blocks instead of
753       stream-of-text blocks.  This mode is useful for moving, copying, delet‐
754       ing  or  saving  columns  of text.  You can also filter columns of text
755       with the ^K / command — if you want to sort a column, for example.  The
756       insert file command, ^K R is also effected.
757
758       When  rectangle  mode is selected, overtype mode (^T T) is also useful.
759       When overtype mode is selected, rectangles will replace  existing  text
760       instead  of  getting inserted before it.  Also the delete block command
761       (^K Y) will clear the selected rectangle with SPACEs and  TABs  instead
762       of  deleting  it.   Overtype  mode  is especially useful for the filter
763       block command (^K /), since it will maintain the original width of  the
764       selected column.
765
766
767   Tag search
768       If  you  are  editing a large C program with many source files, you can
769       use the ctags program to generate a tags file.  This  file  contains  a
770       list  of  program symbols and the files and positions where the symbols
771       are defined.  The ^K ; command can be used to lookup  a  symbol  (func‐
772       tions,  defined  constants,  etc.),  load  the file where the symbol is
773       defined into the current window and position the cursor  to  where  the
774       symbol  is defined.  ^K ; prompts you for the symbol you want, but uses
775       the symbol the cursor was on as a default.  Since ^K ; loads the  defi‐
776       nition  file  into  the  current window, you probably want to split the
777       window first with ^K O, to have both the original file and the  defini‐
778       tion file loaded.
779
780
781   Shell windows
782       Hit ^K ' to run a command shell in one of JOE's windows.  When the cur‐
783       sor is at the end of a shell window (use ^K V if  it's  not),  whatever
784       you type is passed to the shell instead of the window.  Any output from
785       the shell or from commands executed in the shell  is  appended  to  the
786       shell  window (the cursor will follow this output if it's at the end of
787       the shell window).  This command is useful for recording the results of
788       shell commands — for example the output of make, the result of grepping
789       a set of files for a string, or directory listings from  FTP  sessions.
790       Besides typeable characters, the keys ^C, Backspace, DEL, Return and ^D
791       are passed to the shell.  Type the shell exit command to stop recording
792       shell  output.   If  you press ^C in a shell window, when the cursor is
793       not at the end of the window, the shell is killed.
794
795

ENVIRONMENT VARIABLES

797       For JOE to operate correctly, a number of  other  environment  settings
798       must  be correct.  The throughput (baud rate) of the connection between
799       the computer and your terminal must be set correctly for JOE to  update
800       the  screen  smoothly  and  allow typeahead to defer the screen update.
801       Use the stty nnn command to set this.  You want to set it as  close  as
802       possible  to  actual throughput of the connection.  For example, if you
803       are connected via a 1200 baud modem, you want to  use  this  value  for
804       stty.   If  you  are connected via 14.4k modem, but the terminal server
805       you are connected to connects to the computer a 9600 baud, you want  to
806       set your speed as 9600 baud.  The special baud rate of 38400 or extb is
807       used to indicate that you have a very high-speed connection, such as  a
808       memory  mapped  console or an X-Window terminal emulator.  If you can't
809       use stty to set the actual throughput (perhaps because of a modem  com‐
810       municating  with the computer at a different rate than it's communicat‐
811       ing over the phone line), you can put a numeric value in the BAUD envi‐
812       ronment  variable  instead  (use setenv BAUD 9600 for csh or BAUD=9600;
813       export BAUD for sh).
814
815       The SHELL or EXECSHELL environment variable must be  set  to  the  full
816       pathname of a shell executable that accepts the -i (interactive) and -c
817       (run a command) arguments of the  Korn  Shell;  otherwise,  /bin/sh  is
818       used.
819
820       The  TERM  environment  variable  must  be  set to the type of terminal
821       you're using.  If the size (number of lines/columns) of  your  terminal
822       is  different  from  what is reported in the TERMCAP or TERMINFO entry,
823       you can set this with the stty rows nn cols nn command, or  by  setting
824       the LINES and COLUMNS environment variables.
825
826       The xterm-xfree86 terminal allows automatic entering and leaving of the
827       bracketed paste mode.
828
829       The JOETERM environment variable may be set  to  override  the  regular
830       TERM environment variable for specifying your terminal type.
831
832       JOE uses two character maps for its operation: the terminal I/O charac‐
833       ter map, which determines how characters are sent to the  terminal  and
834       whether  the  %a/%A  message specifiers use UCS, and the file encoding,
835       which can be specified per file using the -encoding option and  changed
836       with the ^T E command, and which defaults to the terminal I/O character
837       map, which, in turn, is determined from the current locale, if the sys‐
838       tem  supports such, otherwise the LC_ALL, LC_CTYPE and LANG environment
839       variables (if they contain a period, only the part after it and  before
840       an  optional "at sign" is used); on cygwin32 before 1.7.2, the codepage
841       is used instead if the POSIX locale environment  variables  are  empty;
842       the  environment  variable JOECHARMAP can be used to manually force one
843       overriding all methods described above, and can be used  together  with
844       -encoding to specify a different default file character map.
845
846       JOE  normally  expects  that flow control between the computer and your
847       terminal to use ^S/^Q handshaking (I.E., if  the  computer  is  sending
848       characters  too  fast for your terminal, your terminal sends ^S to stop
849       the output and ^Q to restart it).  If the flow control uses out-of-band
850       or  hardware  handshaking  or if your terminal is fast enough to always
851       keep up with the computer output and you wish to map ^S/^Q to edit com‐
852       mands,  you  can set the environment variable NOXON to have JOE attempt
853       to turn off ^S/^Q handshaking.  If the connection between the  computer
854       and  your  terminal  uses  no handshaking and your terminal is not fast
855       enough to keep up with the output of the  computer,  you  can  set  the
856       environment  variable  DOPADDING  to  have  JOE slow down the output by
857       interspersing  PAD  characters  between  the  terminal  screen   update
858       sequences.
859
860

FILENAMES

862       Wherever  JOE  expects you to enter a file name, whether on the command
863       line or in prompts within the editor, you may also type:
864
865
866       !command
867              Read or write data to or from a shell command.  For example, use
868              joe  '!ls'  to  get  a copy of your directory listing to edit or
869              from within the editor use ^K D !mail  jhallen@world.std.com  to
870              send the file being edited to me.
871
872
873       >>filename
874              Use  this  to  have JOE append the edited text to the end of the
875              file "filename."
876
877
878       filename,START,SIZE
879              Use this to access a fixed section of a file or  device.   START
880              and  SIZE may be entered in decimal (ex.: 123) octal (ex.: 0777)
881              or hexadecimal (ex.: 0xFF).  For example, use joe /dev/fd0,508,2
882              to edit bytes 508 and 509 of the first floppy drive in Linux.
883
884
885       -      Use this to get input from the standard input or to write output
886              to the standard output.  For example, you can put joe in a  pipe
887              of  commands:  quota -v | joe - | mail root, if you want to com‐
888              plain about your low quota.
889
890
891

THE JOERC FILE

893       ^T options, the help screens and the  key-sequence  to  editor  command
894       bindings  are  all defined in JOE's initialisation file.  If you make a
895       copy of this file (which normally resides  in  /etc/jupp/joe/joerc)  to
896       $HOME/.joerc,  you  can  customise  these settings to your liking.  The
897       syntax of the initialisation file should be fairly obvious,  and  there
898       are further instruction in it.
899
900

ACKNOWLEDGMENTS

902       JOE  was  written by Joseph H. Allen.  If you have bug reports or ques‐
903       tions,   eMail   them   to    jhallen@world.std.com.     Larry    Foard
904       (entropy@world.std.com) and Gary Gray (ggray@world.std.com) also helped
905       with the creation of JOE.  Thorsten "mirabilos" Glaser  (tg@mirbsd.org)
906       created JUPP, and the 16-bit MS-DOS version of JUPP 2.8 was compiled by
907       Andreas Totlis (atotlis@t-online.de).
908
909

BUGS

911       This manual page describes only the JOE flavour; documentation for JUPP
912       is especially missing.
913
914
915
916                                                                        JOE(1)
Impressum