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

Environment variables

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

Filenames

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

The joerc file

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

Acknowledgments

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

Bugs

908       This manual page describes only the JOE flavour; documentation for JUPP
909       is especially missing.
910
911
912
913                                                                        JOE(1)
Impressum