1JOE() JOE()
2
3
4
6 JOE - Joe´s Own Editor
7
9 joe [global-options] [ [local-options] filename ]...
10 jstar [global-options] [ [local-options] filename ]...
11 jmacs [global-options] [ [local-options] filename ]...
12 rjoe [global-options] [ [local-options] filename ]...
13 jpico [global-options] [ [local-options] filename ]...
14
16 JOE is a powerful console screen editor. It has a "mode-less" user
17 interface which is similar to many user-friendly PC editors. Users of
18 Micro-Pro´s WordStar or Borland´s "Turbo" languages will feel at home.
19 JOE is a full featured UNIX screen-editor though, and has many features
20 for editing programs and text.
21
22 JOE also emulates several other editors. JSTAR is a close imitation of
23 WordStar with many "JOE" extensions. JPICO is a close imitation of the
24 Pine mailing system´s PICO editor, but with many extensions and
25 improvements. JMACS is a GNU-EMACS imitation. RJOE is a restricted ver‐
26 sion of JOE, which allows you to edit only the files specified on the
27 command line.
28
29 Although JOE is actually five different editors, it still requires only
30 one executable, but one with five different names. The name of the edi‐
31 tor with an "rc" appended gives the name of JOE´s initialization file,
32 which determines the personality of the editor.
33
34 JOE is free software; you can distribute it and/or modify it under the
35 terms of the GNU General Public License as published by the Free Soft‐
36 ware Foundation. JOE is available over the Internet from
37 http://www.sourceforge.net/projects/joe-editor.
38
40 To start the editor, type joe followed by zero or more names of files
41 you want to edit. Each file name may be preceded by a local option set‐
42 ting (see the local options table which follows). Other global options,
43 which apply to the editor as a whole, may also be placed on the command
44 line (see the global options table which follows). If you are editing a
45 new file, you can either give the name of the new file when you invoke
46 the editor, or in the editor when you save the new file. A modified
47 syntax for file names is provided to allow you to edit program output,
48 standard input/output, or sections of files or devices. See the section
49 Filenames below for details.
50
51 Once you are in the editor, you can type in text and use special con‐
52 trol-character sequences to perform other editing tasks. To find out
53 what the control-character sequences are, read the rest of this man
54 page or type ^K H for help in the editor.
55
56 Now for some obscure computer-lore:
57
58 The ^ means that you hold down the Control key while pressing the fol‐
59 lowing key (the same way the Shift key works for uppercase letters). A
60 number of control-key sequences are duplicated on other keys, so that
61 you don´t need to press the control key: Esc will work in place of ^[,
62 Del will work in place of ^?, Backspace will work in place of ^H, Tab
63 will work in place of ^I, Return or Enter will work in place of ^M and
64 Linefeed will work in place of ^J. Some keyboards may give you trouble
65 with some control keys. ^_, ^^ and ^@ can usually be entered without
66 pressing shift (i.e., try ^-, ^6 and ^2). Other keyboards may reassign
67 these to other keys. Try: ^., ^, and ^/. ^Space can usually be used in
68 place of ^@. ^\ and ^] are interpreted by many communication programs,
69 including telnet and kermit. Usually you just hit the key twice to get
70 it to pass through the communication program.
71
72 On some keyboards, holding the Alt key down while pressing another key
73 is the same as typing Esc before typing the other key.
74
75 Once you have typed ^K H, the first help window appears at the top of
76 the screen. You can continue to enter and edit text while the help win‐
77 dow is on. To page through other topics, hit Esc , and Esc . (that is,
78 Esc , and Esc .). Use ^K H to dismiss the help window.
79
80 You can customize the keyboard layout, the help screens and a number of
81 behavior defaults by copying JOE´s initialization file (usually
82 /etc/joe/joerc) to .joerc in your home directory and then by modifying
83 it. See the section joerc below.
84
85 To have JOE used as your default editor for e-mail and News, you need
86 to set the EDITOR and VISUAL environment variables in your shell ini‐
87 tialization file (.cshrc or .profile) to refer to JOE (JOE usually
88 resides as /usr/bin/joe).
89
90 There are a number of other obscure invocation parameters which may
91 have to be set, particularly if your terminal screen is not updating as
92 you think it should. See the section Environment variables below.
93
95 These options can also be specified in the joerc file. Local options
96 can be set depending on the file-name extension. Programs (.c, .h or .p
97 extension) usually have autoindent enabled. Wordwrap is enabled on
98 other files, but rc files have it disabled.
99
100 An option is enabled when it´s given like this:
101
102
103
104 -wordwrap
105
106
107
108 An option is disabled when it´s given like this:
109
110
111
112 --wordwrap
113
114
115
116 Some options take arguments. Arguments are given like this:
117
118
119
120 -lmargin 5
121
122
123
124 The following global options may be specified on the command line:
125
126 · asis
127 Characters with codes above 127 will be sent to the terminal as-is,
128 instead of as inverse of the corresponding character below 128. If
129 this does not work, check your terminal server. This option has no
130 effect if UTF-8 encoding is used.
131
132
133 · assume_256color
134 Assume ANSI-like terminal emulator supports 256 colors even if
135 termcap entry says it doesn´t.
136
137
138 · assume_color
139 Assume ANSI-like terminal emulator supports color even if termcap
140 entry says it doesn´t.
141
142
143 · text_color color
144 Set color for text.
145
146
147 · status_color color
148 Set color for status bar.
149
150
151 · help_color color
152 Set color for help.
153
154
155 · menu_color color
156 Set color for menus.
157
158
159 · prompt_color color
160 Set color for prompts.
161
162
163 · msg_color color
164 Set color for messages.
165
166
167 · autoswap
168 Automatically swap ^K B with ^K K if necessary to mark a legal
169 block during block copy/move commands.
170
171
172 · backpath path
173 Sets path to a directory where all backup files are to be stored.
174 If this is unset (the default) backup files are stored in the
175 directory containing the file.
176
177
178 · baud nnn
179 Set the baud rate for the purposes of terminal screen optimization
180 (overrides value reported by stty). JOE inserts delays for baud
181 rates below 19200, which bypasses tty buffering so that typeahead
182 will interrupt the screen output. Scrolling commands will not be
183 used for 38400 baud and above. This is useful for X-terms and other
184 console ttys which really aren´t going over a serial line.
185
186
187 · beep
188 Enable beeps when edit commands return errors, for example when the
189 cursor goes past extremes.
190
191
192 · break_links
193 When enabled, JOE first deletes the file before writing it in order
194 to break hard-links and symbolic-links.
195
196
197 · break_hardlinks
198 When enabled, and the file is not a symbolic links, JOE first
199 deletes the file before writing it in order to break hard-links.
200
201
202 · brpaste
203 When JOE starts, send command to the terminal emulator that enables
204 "bracketed paste mode" (but only if the terminal seems to have the
205 ANSI command set). In this mode, text pasted into the window is
206 bracketed with ESC [ 2 0 0 ~ and ESC [ 2 0 1 ~.
207
208
209 · columns nnn
210 Set number of columns in terminal emulator (in case termcap entry
211 is wrong). This is only useful on old system which don´t have the
212 "get window size" ioctl.
213
214
215 · csmode
216 Enable continued search mode: Successive ^K Fs repeat the current
217 search instead of prompting for a new one.
218
219
220 · dopadding
221 Enable JOE to send padding NULs to the terminal (for very old ter‐
222 minals).
223
224
225 · exask
226 When set, ^K X prompts for a new name before saving the file.
227
228
229 · floatmouse
230 When set, mouse clicks can position the cursor beyond the ends of
231 lines.
232
233
234 · guess_crlf
235 When set, JOE tries to guess the file format MS-DOS or UNIX.
236
237
238 · guess_indent
239 When set, JOE tries to guess the indentation character and indenta‐
240 tion step based on the contents of the file. The algorithm is to
241 find the greatest common factor of the three most common indenta‐
242 tions found in the file.
243
244
245 · guess_non_utf8
246 When set, enable guessing of non-UTF-8 files in UTF-8 locales.
247
248
249 · guess_utf8
250 When set, enable guessing of UTF-8 files in non-UTF-8 locales.
251
252
253 · guess_utf16
254 When set, enable guessing of UTF-16 files. If a UTF-16BE or
255 UTF-16LE file is detected, it is converted to UTF-8 during load,
256 and converted back to UTF-16 during save.
257
258
259 · helpon
260 When set, start off with the on-line help enabled.
261
262
263 · help_is_utf8
264 When set, the help text in the joerc file is assumed to be UTF-8.
265
266
267 · icase
268 Search is case insensitive by default when set.
269
270
271 · joe_state
272 Enable reading and writing of ~/.joe_state file
273
274
275 · joexterm
276 Set this if xterm was configured with --paste64 option for better
277 mouse support.
278
279
280 · keepup
281 The column number on the status line is updated constantly when
282 this is set, otherwise it is updated only once a second.
283
284
285 · language language
286 Sets language for aspell.
287
288
289 · lightoff
290 Automatically turn off ^K B ^K K highlighting after a block opera‐
291 tion.
292
293
294 · lines nnn
295 Set number of lines in terminal emulator (in case termcap entry is
296 wrong). This is only useful on old system which don´t have the "get
297 window size" ioctl.
298
299
300 · marking
301 Enable marking mode: highlights between ^K B and cursor.
302
303
304 · menu_above
305 Put menus above prompt instead of below them.
306
307
308 · menu_explorer
309 Stay in menu when a directory is selected (otherwise the directory
310 is added to the path and the cursor jumps back to the prompt).
311
312
313 · menu_jump
314 Jump into the file selection menu when Tab Tab is hit.
315
316
317 · mid
318 If this option is set and the cursor moves off the window, the win‐
319 dow will be scrolled so that the cursor is in the center. This
320 option is forced on slow terminals which don´t have scrolling com‐
321 mands.
322
323
324 · left nn
325 This sets the number of columns the screen scrolls to the left when
326 cursor moves past the left edge or when the crawll command is
327 issued. If nn is negative, then it´s the fraction of the screen to
328 scroll. For example, -2 means scroll 1/2 the screen.
329
330
331 · right nn
332 This sets the number of columns the screen scrolls to the right
333 when cursor moves past the right edge or when the crawlr command is
334 issued. If nn is negative, then it´s the fraction of the screen to
335 scroll. For example, -3 means scroll 1/3 the screen.
336
337
338 · mouse
339 Enable xterm mouse support.
340
341
342 · nobackups
343 Disable backup files.
344
345
346 · nocurdir
347 Disable current-directory prefix in prompts.
348
349
350 · noexmsg
351 Disable exiting message ("File not changed so no update needed")
352
353
354 · nolinefeeds
355 Disable sending linefeeds to preserve screen history in terminal
356 emulator´s scroll-back buffer (only relevant when notite mode is
357 enabled).
358
359
360 · nolocks
361 Disable EMACS compatible file locks.
362
363
364 · nomodcheck
365 Disable periodic file modification check.
366
367
368 · nonotice
369 This option prevents the copyright notice from being displayed when
370 the editor starts.
371
372
373 · nosta
374 This option eliminates the top-most status line. It´s nice for when
375 you only want to see your text on the screen or if you´re using a
376 vt52.
377
378
379 · notagsmenu
380 Disable selection menu for tags search with multiple results.
381
382
383 · notite
384 Disable ti and te termcap sequences which are usually set up to
385 save and restore the terminal screen contents when JOE starts and
386 exits.
387
388
389 · pastehack
390 If keyboard input comes in as one block assume it´s a mouse paste
391 and disable autoindent and wordwrap.
392
393
394 · noxon
395 Disable ^S and ^Q flow control, possibly allowing ^S and ^Q to be
396 used as editor keys.
397
398
399 · orphan
400 Orphan extra files given on the command line instead of creating
401 windows for them (the files are loaded, but you need to use
402 switch-buffer commands to access them).
403
404
405 · pg nnn
406 Set number of lines to keep during Page Up and Page Down (use -1
407 for 1/2 window size).
408
409
410 · regex
411 Use standard regular expression syntax by default, instead of the
412 JOE syntax (where special characters have their meaning only when
413 preceded with backslash).
414
415
416 · restore
417 Set to have cursor positions restored to last positions of previ‐
418 ously edited files.
419
420
421 · rtbutton
422 Swap left and right mouse buttons.
423
424
425 · search_prompting
426 Show previous search string in search command (like in PICO).
427
428
429 · skiptop nnn
430 When set to N, the first N lines of the terminal screen are not
431 used by JOE and are instead left with their original contents. This
432 is useful for programs which call JOE to leave a message for the
433 user.
434
435
436 · square
437 Enable rectangular block mode.
438
439
440 · transpose
441 Transpose rows with columns in all menus.
442
443
444 · title
445 Display context (titles) in status line. When enabled this shows
446 the first line of the function that the cursor is in on the status
447 line. The syntax file context.jsf identifies which lines are title
448 lines.
449
450
451 · type
452 Select file type, overriding the automatically determined type. The
453 file types are defined in the ftyperc file.
454
455
456 · undo_keep nnn
457 Sets number of undo records to keep (0 means infinite).
458
459
460 · usetabs
461 Set to allow rectangular block operations to use tabs.
462
463
464 · wrap
465 Enable search to wrap to beginning of file.
466
467
468
469
470 The following local options may be specified on the command line:
471
472 · +nnn
473 The cursor starts on the specified line.
474
475
476 · autoindent
477 Enable auto-indent mode. When you hit Enter on an indented line,
478 the indentation is duplicated onto the new line.
479
480
481 · c_comment
482 Enable ^G skipping of C-style comments /.../
483
484
485 · cpara characters
486 Sets list of characters which can indent paragraphs.
487
488
489 · cnotpara characters
490 Sets list of characters which begin lines which are definitely not
491 part of paragraphs.
492
493
494 · cpp_comment
495 Enable ^G skipping of C++-style comments // ...
496
497
498 · crlf
499 JOE uses CR-LF as the end of line sequence instead of just LF. This
500 is for editing MS-DOS or VMS files.
501
502
503 · encoding encoding
504 Set file encoding (like utf-8 or 8859-1).
505
506
507 · flowed
508 Set to force an extra space after each line of a paragraph but the
509 last.
510
511
512 · force
513 When set, a final newline is appended to the file if there isn´t
514 one when the file is saved.
515
516
517 · french
518 When set, only one space is inserted after periods in paragraph
519 reformats instead of two.
520
521
522 · hex
523 Enable hex-dump mode.
524
525
526 · highlight
527 Enable syntax highlighting.
528
529
530 · highlighter_context
531 Enable use of syntax file to identify comments and strings which
532 should be skipped over during ^G matching.
533
534
535 · indentc nnn
536 Sets the indentation character for shift left and shift right (^K ,
537 and ^K .). Use 32 for Space, 9 for Tab.
538
539
540 · indentfirst
541 When set, the smart home key jumps to the indentation point first,
542 otherwise it jumps to column 1 first.
543
544
545 · istep nnn
546 Sets indentation step.
547
548
549 · linums
550 Enable line number display.
551
552
553 · lmargin
554 Set left margin.
555
556
557 · lmsg
558 Define left-side status bar message.
559
560
561 · overwrite
562 Enable overtype mode. Typing overwrites existing characters instead
563 of inserting before them.
564
565
566 · picture
567 Enable "picture" mode- allows cursor to go past ends of lines.
568
569
570 · pound_comment
571 ^G ignores # ... comments.
572
573
574 · purify
575 Fix indentation if necessary before shifting or smart backspace.
576 For example, if indentation uses a mix of tabs and spaces, and
577 indentc is space, then indentation will be converted to all spaces
578 before the shifting operation.
579
580
581 · rdonly
582 Set read-only mode.
583
584
585 · rmargin nnn
586 Set right margin.
587
588
589 · rmsg string
590 Define right-side status bar message.
591
592
593 · semi_comment
594 ^G ignores ; ... comments.
595
596
597 · single_quoted
598 ^G ignores ´...´
599
600
601 · smartbacks
602 Enable smart backspace and tab. When this mode is set backspace and
603 tab indent or unindent based on the values of the istep and indentc
604 options.
605
606
607 · smarthome
608 Home key first moves cursor to beginning of line, then if hit
609 again, to the first non-blank character.
610
611
612 · smsg string
613 Define status command format when cursor is on a character.
614
615
616 · spaces
617 Insert spaces when Tab key is hit.
618
619
620 · syntax syntax
621 Set syntax for syntax highlighting.
622
623
624 · tab nnn
625 Set tab stop width.
626
627
628 · text_delimiters word delimiter list
629 Give list of word delimiters which ^G will step through.
630
631
632
633 For example, "begin=end:if=elif=else=endif" means that ^G will jump
634 between the matching if, elif, else and endif.
635
636 · vhdl_comment
637 ^G ignores -- ... comments
638
639
640 · wordwrap
641 JOE wraps the previous word when you type past the right margin.
642
643
644 · zmsg string
645 Define status command format when cursor is at end of file.
646
647
648 · xmsg string
649 Define startup message (usually the copyright notice).
650
651
652 · aborthint string
653 Give the key sequence to show in prompts for abort (usually ^C).
654
655
656 · helphint string
657 Give the key sequence to show in prompts for help (usually ^K H).
658
659
660
661
662 Colors and attributes
663 Combine attributes and up to one foreground color and one background
664 color to create arguments for color options like text_color. For exam‐
665 ple: bold+bg_green+blue
666
667 · Attributes: bold, inverse, blink, dim, underline, and italic
668
669 · Foreground colors: white, cyan, magenta, blue, yellow, green, red,
670 or black
671
672 · Background colors: bg_white, bg_cyan, bg_magenta, bg_blue, bg_yel‐
673 low, bg_green, bg_red or bg_black
674
675
676
677 With a 16 color or 256 color terminal emulator (export
678 TERM=xterm-16color), these brighter than normal colors become avail‐
679 able:
680
681 · Foreground: WHITE, CYAN, MAGENTA, BLUE, YELLOW, GREEN, RED or BLACK
682
683 · Background: bg_WHITE, bg_CYAN, bg_MAGENTA, bg_BLUE, bg_YELLOW,
684 bg_GREEN, bg_RED or bg_BLACK
685
686
687
688 With a 256 color terminal emulator (export TERM=xterm-256color), these
689 become available:
690
691 · fg_RGB and bg_RGB, where R, G and B rand from 0 - 5. So: fg_500 is
692 bright red.
693
694 · fg_NN and bg_NN give shades of grey, where the intensity, NN,
695 ranges from 0 - 23.
696
697
698
699 Status line definition strings
700 -lmsg defines the left-justified string and -rmsg defines the
701 right-justified string. The first character of -rmsg is the background
702 fill character.
703
704 -smsg defines the status command (^K Space). -zmsg defines it when the
705 cursor is at the end of the file. The last character of smsg or zmsg is
706 the fill character.
707
708 The following escape sequences can be used in these strings:
709
710
711
712 %t 12 hour time
713 %u 24 hour time
714 %T O for overtype mode, I for insert mode
715 %W W if wordwrap is enabled
716 %I A if autoindent is enabled
717 %X Rectangle mode indicator
718 %n File name
719 %m ´(Modified)´ if file has been changed
720 %* ´*´ if file has been changed
721 %R Read-only indicator
722 %r Row (line) number
723 %c Column number
724 %o Byte offset into file
725 %O Byte offset into file in hex
726 %a Ascii value of character under cursor
727 %A Ascii value of character under cursor in hex
728 %w Width of character under cursor
729 %p Percent of file cursor is at
730 %l No. lines in file
731 %k Entered prefix keys
732 %S ´*SHELL*´ if there is a shell running in window
733 %M Macro recording message
734 %y Syntax
735 %e Encoding
736 %x Context (first non-indented line going backwards)
737 %dd day
738 %dm month
739 %dY year
740 %Ename% value of environment variable
741 %Tname% value of option (ON or OFF for Boolean options)
742
743
744
745 These formatting escape sequences may also be given:
746
747
748
749 \i Inverse
750 \u Underline
751 \b Bold
752 \d Dim
753 \f Blink
754 \l Italic
755
756
757
759 When you type characters into the editor, they are normally inserted
760 into the file being edited (or appended to the file if the cursor is at
761 the end of the file). This is the normal operating mode of the editor.
762 If you want to replace some existing text, you have to delete the old
763 text before or after you type in the replacement text. The Backspace
764 key can be used for deleting text: move the cursor to right after the
765 text you want to delete and hit Backspace a number of times.
766
767 Hit the Enter or Return key to insert a line-break. For example, if the
768 cursor was in the middle of a line and you hit Enter, the line would be
769 split into two lines with the cursor appearing at the beginning of the
770 second line. Hit Backspace at the beginning of a line to eliminate a
771 line-break.
772
773 Use the arrow keys to move around the file. If your keyboard doesn´t
774 have arrow keys (or if they don´t work for some reason), use ^F to move
775 forwards (right), ^B to move backwards (left), ^P to move to the previ‐
776 ous line (up), and ^N to move to the next line (down). The right and
777 left arrow keys simply move forwards or backwards one character at a
778 time through the text: if you´re at the beginning of a line and you
779 press left-arrow, you will end up at the end of the previous line. The
780 up and down arrow keys move forwards and backwards by enough characters
781 so that the cursor appears in the same column that it was in on the
782 original line.
783
784 If you want to indent the text you enter, you can use the Tab key. This
785 inserts a special control character which makes the characters which
786 follow it begin at the next tab stop. Tab stops normally occur every 8
787 columns, but this can be changed with the ^T D command. PASCAL and C
788 programmers often set tab stops on every 4 columns.
789
790 If for some reason your terminal screen gets messed up (for example, if
791 you receive a mail notice from biff), you can have the editor refresh
792 the screen by hitting ^R.
793
794 There are many other keys for deleting text and moving around the file.
795 For example, hit ^D to delete the character the cursor is on instead of
796 deleting backwards like Backspace. ^D will also delete a line-break if
797 the cursor is at the end of a line. Type ^Y to delete the entire line
798 the cursor is on or ^J to delete just from the cursor to the end of the
799 line.
800
801 Hit ^A to move the cursor to the beginning of the line it´s on. Hit ^E
802 to move the cursor to the end of the line. Hit ^U or ^V for scrolling
803 the cursor up or down 1/2 a screen´s worth.
804 "Scrolling" means that the text on the screen moves, but the cursor
805 stays at the same place relative to the screen. Hit ^K U or ^K V to
806 move the cursor to the beginning or the end of the file. Look at the
807 help screens in the editor to find even more delete and movement com‐
808 mands.
809
810 If you make a mistake, you can hit ^_ to "undo" it. On most keyboards
811 you hit just ^- to get ^_, but on some you might have to hold both the
812 Shift and Control keys down at the same time to get it. If you "undo"
813 too much, you can "redo" the changes back into existence by hitting ^^
814 (type this with just ^6 on most keyboards).
815
816 Cursor position history
817 If you were editing in one place within the file, and you then tempo‐
818 rarily had to look or edit some other place within the file, you can
819 get back to the original place by hitting ^K -. This command actually
820 returns you to the last place you made a change in the file. You can
821 step through a history of places with ^K - and ^K =, in the same way
822 you can step through the history of changes with the "undo" and "redo"
823 commands.
824
825 Save and exit
826 When you are done editing the file, hit ^K X to exit the editor. You
827 will be prompted for a file name if you hadn´t already named the file
828 you were editing.
829
830 When you edit a file, you actually edit only a copy of the file. So if
831 you decide that you don´t want the changes you made to a file during a
832 particular edit session, you can hit ^C to exit the editor without sav‐
833 ing them.
834
835 If you edit a file and save the changes, a backup copy of that file is
836 created in the current directory, with a ~ appended to the name, which
837 contains the original version of the file.
838
839 File operations
840 You can hit ^K D to save the current file (possibly under a different
841 name from what the file was called originally). After the file is
842 saved, you can hit ^K E to edit a different file.
843
844 If you want to save only a selected section of the file, see the sec‐
845 tion on Blocks below.
846
847 If you want to include another file in the file you´re editing, use ^K
848 R to insert it.
849
850 Filenames
851 Wherever JOE expects you to enter a file name, whether on the command
852 line or in prompts within the editor, you may also type:
853
854 · !command
855
856
857
858 To read or write data to or from a shell command. For example, use joe
859 ´!ls´ to get a copy of your directory listing to edit or from within
860 the editor use ^K D !mail jhallen@world.std.com to send the file being
861 edited to me.
862
863 · >>filename
864
865
866
867 Use this to have JOE append the edited text to the end of the file
868 "filename."
869
870 · filename,START,SIZE
871
872
873
874 Use this to access a fixed section of a file or device. START and SIZE
875 may be entered in decimal (ex.: 123) octal (ex.: 0777) or hexadecimal
876 (ex.: 0xFF). For example, use joe /dev/fd0,508,2 to edit bytes 508 and
877 509 of the first floppy drive in Linux.
878
879 · -
880
881
882
883 Use this to get input from the standard input or to write output to the
884 standard output. For example, you can put JOE in a pipe of commands:
885 quota -v | joe | mail root, if you want to complain about your low
886 quota.
887
888 Using JOE in a shell script
889 JOE used to use /dev/tty to access the terminal. This caused a problem
890 with idle-session killers (they would kill JOE because the real tty
891 device was not being accessed for a long time), so now JOE only uses
892 /dev/tty if you need to pipe a file into JOE, as in:
893
894
895
896 echo "hi" | joe
897
898
899
900 If you want to use JOE in a shell script which has its stdin/stdout
901 redirected, but you do not need to pipe to it, you should simply redi‐
902 rect JOE´s stdin/stdout to /dev/tty:
903
904
905
906 joe filename </dev/tty >/dev/tty
907
908
909
910 Word wrap and formatting
911 If you type past the right edge of the screen in a C or PASCAL language
912 file, the screen will scroll to the right to follow the cursor. If you
913 type past the right edge of the screen in a normal file (one whose name
914 doesn´t end in .c, .h or .p), JOE will automatically wrap the last word
915 onto the next line so that you don´t have to hit Enter. This is called
916 word-wrap mode. Word-wrap can be turned on or off with the ^T W com‐
917 mand. JOE´s initialization file is usually set up so that this mode is
918 automatically turned on for all non-program files. See the section
919 below on the joerc file to change this and other defaults.
920
921 Aside for Word-wrap mode, JOE does not automatically keep paragraphs
922 formatted like some word-processors. Instead, if you need a paragraph
923 to be reformatted, hit ^K J. This command "fills in" the paragraph that
924 the cursor is in, fitting as many words in a line as is possible. A
925 paragraph, in this case, is a block of text separated above and below
926 by a blank line.
927
928 The margins which JOE uses for paragraph formatting and word-wrap can
929 be set with the ^T L and ^T R commands. If the left margin is set to a
930 value other than 1, then when you start typing at the beginning of a
931 line, the cursor will immediately jump to the left margin.
932
933 There are a number of options which control the paragraph reformatter
934 and word wrapper:
935
936 · The cpara option provides a list of characters which can indent a
937 paragraph. For example, in e-mail quoted matter is indicated by >
938 at the beginnings of line, so this character should be in the cpara
939 list.
940
941 · The cnotpara option provides a list of characters which, if they
942 are the first non-whitespace character of a line, indicate that the
943 line is not to be included as part of a paragraph for formatting.
944 For example, lines beginning with ´.´ in nroff can not be paragraph
945 lines.
946
947 · Autoindent mode affects the formatter. If autoindent is disabled,
948 only the first line will be indented. If autoindent is enabled, the
949 entire paragraph is indented.
950
951 · french determines how many spaces are inserted after periods.
952
953 · When flowed is enabled, a space is inserted after each but the last
954 line of the paragraph. This indicates that the lines belong
955 together as a single paragraph in some programs.
956
957 · When overtype is enabled, the word wrapper will not insert lines.
958
959
960
961 Centering
962 If you want to center a line within the margins, use the ^K A command.
963
964 Spell checker
965 Hit Esc N to check the spelling of the word the cursor is on using the
966 aspell program (or ispell program if you modify the joerc file). Hit
967 Esc L to check the highlighted block or the entire file if no block is
968 highlighted.
969
970 JOE passes the language and character encoding to the spell checker. To
971 change the language, hit ^T V. For example, use en_US for English.
972
973 Overtype mode
974 Sometimes it´s tiresome to have to delete old text before or after you
975 insert new text. This happens, for example, when you are changing a ta‐
976 ble and you want to maintain the column position of the right side of
977 the table.
978 When this occurs, you can put the editor in overtype mode with ^T T.
979 When the editor is in this mode, the characters you type in replace
980 existing characters, in the way an idealized typewriter would. Also,
981 Backspace simply moves left instead of deleting the character to the
982 left, when it´s not at the end or beginning of a line. Overtype mode is
983 not the natural way of dealing with text electronically, so you should
984 go back to insert-mode as soon as possible by typing ^T T again.
985
986 If you need to insert while you´re in overtype mode, hit ^@. This
987 inserts a single Space into the text.
988
989 Control and Meta characters
990 Each character is represented by a number. For example, the number for
991 ´A´ is 65 and the number for ´1´ is 49. All of the characters which you
992 normally see have numbers in the range of 32 - 126 (this particular
993 arbitrary assignment between characters and numbers is called the ASCII
994 character set). The numbers outside of this range, from 0 to 255,
995 aren´t usually displayed, but sometimes have other special meanings.
996 The number 10, for example, is used for the line-breaks. You can enter
997 these special, non-displayed control characters by first hitting ^Q and
998 then hitting a character in the range @ A B C ... X Y Z [ ^ ] \ _ to
999 get the number 0 - 31, and ? to get 127. For example, if you hit ^Q J,
1000 you´ll insert a line-break character, or if you hit ^Q I, you´ll insert
1001 a Tab character (which does the same thing the Tab key does). A useful
1002 control character to enter is 12 (^Q L), which causes most printers to
1003 advance to the top of the page. You´ll notice that JOE displays this
1004 character as an underlined L. You can enter the characters above 127,
1005 the meta characters, by first hitting ^\. This adds 128 to the next
1006 (possibly control) character entered. JOE displays characters above 128
1007 in inverse-video. Some foreign languages, which have more letters than
1008 English, use the meta characters for the rest of their alphabet. You
1009 have to put the editor in asis mode to have these passed untranslated
1010 to the terminal.
1011
1012 Note: JOE now normally passes all 8-bits to the terminal unless the
1013 locale is set to C or POSIX. If the locale is C or POSIX, then the asis
1014 flag determines if meta characters are shown in inverse video or passed
1015 directly to the terminal.
1016
1017 Note: In older version of JOE, you had to use Esc ´ to enter control
1018 characters.
1019
1021 JOE natively handles two classes of character sets: UTF-8 and byte
1022 coded (like ISO-8859-1). For these character sets, the file is loaded
1023 as-is into memory, and is exactly preserved during save, even if it
1024 contains UTF-8 coding errors.
1025
1026 It can not yet natively handle other major classes such as UTF-16 or
1027 GB2312. There are other restrictions: character sets must use LF (0x0A)
1028 or CR-LF (0x0D - 0x0A) as line terminators, space must be 0x20 and tab
1029 must be 0x09. Basically, the files must be UNIX or MS-DOS compatible
1030 text files.
1031
1032 This means EBCDIC will not work properly (but you would need to handle
1033 fixed record length lines anyway) and character sets which use CR ter‐
1034 minated lines (MACs) will not yet work.
1035
1036 JOE now supports UTF-16 (both big endian and little endian). It sup‐
1037 ports UTF-16 by converting to UTF-8 during load, and converting back to
1038 UTF-16 during save.
1039
1040 The terminal and the file can have different encodings. JOE will trans‐
1041 late between the two. Currently, one of the two must be UTF-8 for
1042 translation to work.
1043
1044 The character set for the terminal and the default character set
1045 assumed for files is determined by the ´LC_ALL´ environment variable
1046 (and if that´s not set, LC_CTYPE and LANG are also checked).
1047
1048 For example, if LC_ALL is set to:
1049
1050
1051
1052 de_DE
1053
1054
1055
1056 Then the character set will be ISO-8859-1.
1057
1058 If LC_ALL is set to:
1059
1060
1061
1062 de_DE.UTF-8
1063
1064
1065
1066 The character set will be UTF-8.
1067
1068 Hit ^T E to change the coding for the file. Hit Tab Tab at this prompt
1069 to get a list of available codings. There are a number of built-in
1070 character sets, plus you can install character sets in the
1071 ~/.joe/charmaps and /usr/share/joe/charmaps directories.
1072
1073 Check: /usr/share/i18n/charmaps for example character set files. Only
1074 byte oriented character sets will work. Also, the file should not be
1075 gzipped (all of the charmap files in /usr/share/i18n/charmaps on my
1076 computer were compressed). The parser is very bad, so basically the
1077 file has to look exactly like the example one in
1078 /usr/share/joe/charmaps.
1079
1080 You can hit ^K Space to see the current character set.
1081
1082 You can hit ^Q x to enter a Unicode character if the file coding is
1083 UTF-8.
1084
1086 Most prompts record a history of the responses you give them. You can
1087 hit up and down arrow to step through these histories.
1088
1089 Prompts are actually single line windows with no status line, so you
1090 can use any editing command that you normally use on text within the
1091 prompts. The prompt history is actually just other lines of the same
1092 "prompt file". Thus you can can search backwards though the prompt his‐
1093 tory with the normal ^K F command if you want.
1094
1095 Since prompts are windows, you can also switch out of them with ^K P
1096 and ^K N.
1097
1098 Completion and selection menus
1099 You can hit Tab in just about any prompt to request JOE to complete the
1100 word you are typing. If JOE beeps, there are either no completions or
1101 many. As with the "bash" shell, hit Tab twice to bring up a list of all
1102 the possibilities. This list is actually a menu, but by default, the
1103 cursor does not jump into it since it is usually easier to just type in
1104 your selection. You can, however, jump into the menu window with ^K P
1105 (move to previous window) and use the arrow keys and <Enter> to make
1106 your selection. Also in a menu, you can hit the first letter of any of
1107 the items to make the cursor jump directly to it. The ^T option menu
1108 works like this.
1109
1110 If the menu is too large to fit in the window, you can hit Page Up and
1111 Page Down to scroll it (even if you have not jumped into it).
1112
1113 Tab completion works in the search and replace prompts as well. In this
1114 case, JOE tries to complete the word based on the contents of the buf‐
1115 fer. If you need search for the Tab character itself, you can enter it
1116 with ^Q Tab.
1117
1118 Also, you can hit Esc Enter in a text window to request JOE to complete
1119 the word you are typing. As with the search prompt, JOE tries to com‐
1120 plete the word based on the contents of the buffer. It will bring up a
1121 menu of possibilities if you hit Esc Enter twice.
1122
1124 Hit ^K Space to have JOE report the line number, column number, and
1125 byte number on the last line of the screen. The number associated with
1126 the character the cursor is on (its ASCII code) is also shown. You can
1127 have the line number and/or column number always displayed on the sta‐
1128 tus line by placing the appropriate escape sequences in the status line
1129 setup strings. Edit the joerc file for details.
1130
1132 Hit the space bar. This runs an innocuous command (it shows the line
1133 number on the status bar).
1134
1136 If you need to temporarily stop the editor and go back to the shell,
1137 hit ^K Z. You might want to do this to stop whatever you´re editing and
1138 answer an e-mail message or read this man page, for example. You have
1139 to type fg or exit (you´ll be told which when you hit ^K Z) to return
1140 to the editor.
1141
1143 Hit ^K F to have the editor search forwards or backwards for a text
1144 fragment (string) for you. You will be prompted for the text to search
1145 for. After you hit Enter, you are prompted to enter options.
1146 You can just hit Enter again to have the editor immediately search for‐
1147 wards for the text, or you can enter one or more of these options:
1148
1149 · b
1150
1151
1152
1153
1154 Search backwards instead of forwards.
1155
1156 · i
1157
1158
1159
1160
1161 Treat uppercase and lower case letters as the same when searching. Nor‐
1162 mally uppercase and lowercase letters are considered to be different.
1163
1164 · nnn
1165
1166
1167
1168
1169 (where nnn is a number) If you enter a number, JOE searches for the Nth
1170 occurrence of the text. This is useful for going to specific places in
1171 files structured in some regular manner.
1172
1173 · r
1174
1175
1176
1177
1178 Replace text. If you enter the r option, then you will be further
1179 prompted for replacement text. Each time the editor finds the search
1180 text, you will be prompted as to whether you want to replace the found
1181 search text with the replacement text. You hit: y to replace the text
1182 and then find the next occurrence, n to not replace this text, but to
1183 then find the next occurrence, r to replace all of the remaining occur‐
1184 rences of the search text in the remainder of the file without asking
1185 for confirmation (subject to the nnn option above), or ^C to stop
1186 searching and replacing.
1187
1188 You can also hit B or Backspace to back up to the previously found text
1189 (if it had been replaced, the replacement is undone).
1190
1191 · a
1192
1193
1194
1195
1196 The search covers all loaded buffers. So to replace all instances of
1197 "foo" with "bar" in all .c files in the current directory:
1198
1199
1200
1201 joe *.c
1202 ^K F
1203 foo <Enter>
1204 ra <Enter>
1205 bar <Enter>
1206
1207
1208
1209 · e
1210
1211
1212
1213
1214 The search covers all files in the grep or make error list. You can use
1215 a UNIX command to generate a list of files and search and replace
1216 through the list. So to replace all instances of "foo" with "bar" in
1217 all .c files which begin with f. You can also use "ls" and "find"
1218 instead of grep to create the file list.
1219
1220
1221
1222 Esc G
1223 grep -n foo f*.c <Enter>
1224 ^K F
1225 foo <Enter>
1226 re <Enter>
1227 bar <Enter>
1228
1229
1230
1231 · x
1232
1233
1234
1235
1236 JOE will use the standard syntax for regular expressions if this option
1237 is given. In the standard syntax, these characters have their special
1238 meanings directly, and do not have to be escaped with backslash: ., *,
1239 +, ?, {, }, (, ), |, ^, $ and [.
1240
1241 · y
1242
1243
1244
1245
1246 JOE will use the JOE syntax for regular expressions instead of the
1247 standard syntax. This overrides the "-regex" option.
1248
1249 · v
1250
1251
1252
1253
1254 JOE will send debug information about the regular expression to the
1255 startup log. The log can be viewed with the showlog command.
1256
1257 You can hit ^L to repeat the previous search.
1258
1259 You can hit ^K H at the search and replace options prompt to bring up a
1260 list of all search and replace options.
1261
1262 Regular Expressions
1263 A number of special character sequences may be entered as search text:
1264
1265 · \*
1266
1267
1268
1269
1270 This finds zero or more of the item to the left. For example, if you
1271 give AB\*C as the search text, JOE will try to find an A followed by
1272 any number of Bs, and then a C.
1273
1274 · \+
1275
1276
1277
1278
1279 This finds one or more of the item to the left. For example, if you
1280 give AB\+C as the search text, JOE will try to find an A followed by
1281 one or more Bs, and then a C.
1282
1283 · \?
1284
1285
1286
1287
1288 This indicates that the item to the left is optional. For example, if
1289 you give AB\?C as the search text, JOE will find AC or ABC.
1290
1291 · \{min,max}
1292
1293
1294
1295
1296 This indicates that JOE should try to find a string with a specific
1297 number of occurrences of the item to the left. For example, AX\{2,5}B
1298 will match these strings: AXXB, AXXXB, AXXXXB, and AXXXXXB. Min can be
1299 left out to indicate 0 occurrences. Max (and the comma) can be left out
1300 to indicate any number of occurrences.
1301
1302 · \.
1303
1304
1305
1306
1307 This finds exactly one character. For example, if you give A\.B as the
1308 search text, JOE will find AXB, but not AB or AXXB.
1309
1310 · \!
1311
1312
1313
1314
1315 This works like ., but matches a balanced C-language expression. For
1316 example, if you search for malloc(\!\*), then JOE will find all func‐
1317 tion calls to malloc, even if there was a ) within the parenthesis.
1318
1319 · \|
1320
1321
1322
1323
1324 This finds the item on the left or the item on the right. For example,
1325 if you give A\|B as the search text, JOE will try to find either an A
1326 or a B.
1327
1328 · \( \)
1329
1330
1331
1332
1333 Use these to group characters together. For example, if you search for
1334 \(foo\)\+, then JOE will find strings like "foo", and "foofoofoo".
1335
1336 · ^ \$
1337
1338
1339
1340
1341 These match the beginnings and endings of lines. For example, if you
1342 give ^test\$, then JOE with find test on a line by itself.
1343
1344 · \\\
1345
1346
1347
1348
1349 These match the beginnings and endings of words. For example, if you
1350 give \is\\, then JOE will find the word "is" but will not find the "is"
1351 in "this".
1352
1353 · \[...]
1354
1355
1356
1357
1358 This matches any single character which appears within the brackets.
1359 For example, if \[Tt]his is entered as the search string, then JOE
1360 finds both This and this. Ranges of characters can be entered within
1361 the brackets. For example, \[A-Z] finds any uppercase letter. If the
1362 first character given in the brackets is ^, then JOE tries to find any
1363 character not given in the the brackets. To include - itself, include
1364 it as the last or first character (possibly after ^).
1365
1366 · \\
1367
1368
1369
1370
1371 Matches a single \.
1372
1373 · \n
1374
1375
1376
1377
1378 This finds the special end-of-line or line-break character.
1379
1380 A number of special character sequences may also be given in the
1381 replacement string:
1382
1383 · \&
1384
1385
1386
1387
1388 This gets replaced by the text which matched the search string. For
1389 example, if the search string was \\*\\, which matches words, and you
1390 give "\&", then JOE will put quote marks around words.
1391
1392 · \1 - \9
1393
1394
1395
1396
1397 These get replaced with the text which matched the Nth grouping; the
1398 text within the Nth set of \( \).
1399
1400 · \l, \u
1401
1402
1403
1404
1405 Convert the next character of the replacement text to lowercase or
1406 uppercase.
1407
1408 · \L, \U
1409
1410
1411
1412
1413 Convert all following replacement text to lowercase or uppercase. Con‐
1414 version stops when \E is encountered.
1415
1416 · \\
1417
1418
1419
1420
1421 Use this if you need to put a \ in the replacement string.
1422
1423 · \n
1424
1425
1426
1427
1428 Use this if you need to put a line-break in the replacement string.
1429
1430 Some examples:
1431
1432 Suppose you have a list of addresses, each on a separate line, which
1433 starts with "Address:" and has each element separated by commas. Like
1434 so:
1435
1436 Address: S. Holmes, 221b Baker St., London, England
1437
1438 If you wanted to rearrange the list, to get the country first, then the
1439 city, then the person´s name, and then the address, you could do this:
1440
1441 Type ^K F to start the search, and type:
1442
1443 Address:\(\.\*\),\(\.\*\),\(\.\*\),\(\.\*\)\$
1444
1445 to match "Address:", the four comma-separated elements, and then the
1446 end of the line. When asked for options, you would type r to replace
1447 the string, and then type:
1448
1449 Address:\4,\3,\1,\2
1450
1451 To shuffle the information the way you want it. After hitting return,
1452 the search would begin, and the sample line would be changed to:
1453
1454 Address: England, London, S. Holmes, 221b Baker St.
1455
1456 Escape sequences
1457 JOE understands the following escape sequences withing search and
1458 replacement strings:
1459
1460 · \x{10ffff}
1461
1462
1463
1464
1465 This matches a specific Unicode code point given in hexadecimal.
1466
1467 · \xFF
1468
1469
1470
1471
1472 This matches a specific character specified in hexadecimal.
1473
1474 · \377
1475
1476
1477
1478
1479 This matches a specific character specified in octal.
1480
1481 · \p{Ll}
1482
1483
1484
1485
1486 This matches any character in the named Unicode category or block.
1487
1488 The block names, such as "Latin-1 Supplement" or "Arabic" can be found
1489 here:
1490
1491 Unicode Blocks ftp://ftp.unicode.org/Public/8.0.0/ucd/Blocks.txt
1492
1493 The category names such as "Ll" can be found here:
1494
1495 Unicode Categories ftp://ftp.unicode.org/Public/5.1.0/ucd/UCD.html#Gen‐
1496 eral_Category_Values
1497
1498 Note that a single letter matches all of the category names which start
1499 with that letter. For example, \p{N} (any number) include \p{Nd} (deci‐
1500 mal digit), \p{Nl} (letter number) and \p{No} (other number).
1501
1502 · \d
1503
1504
1505
1506
1507 This matches any Unicode digit. This is the same as \p{Nd}.
1508
1509 · \D
1510
1511
1512
1513
1514 This matches anything except for a Unicode digit. This is the same as
1515 \[^\p{Nd}].
1516
1517 · \w
1518
1519
1520
1521
1522 This matches any word character. This is the same as
1523 \[^\p{C}\p{P}\p{Z}].
1524
1525 · \W
1526
1527
1528
1529
1530 This matches anything except for a word character. This is the same as
1531 \[\p{C}\p{P}\p{Z}].
1532
1533 · \s
1534
1535
1536
1537
1538 This matches any space character. This is the same as \[\t\r\f\n\p{Z}].
1539
1540 · \S
1541
1542
1543
1544
1545 This matches anything except for a spacing character. This is the same
1546 as \[^\t\r\f\n\p{Z}].
1547
1548 · \i
1549
1550
1551
1552
1553 This matches an identifier start character. This is the same as
1554 \[\p{L}\p{Pc}\p{Nl}].
1555
1556 · \I
1557
1558
1559
1560
1561 This matches anything except for an identifier start character. This is
1562 the same as \[^\p{L}\p{Pc}\p{Nl}].
1563
1564 · \c
1565
1566
1567
1568
1569 This matches an identifier continuation character. This is the same as
1570 \[\i\p{Mn}\p{Mc}\p{Nd}\x{200c}\x{200d}].
1571
1572 · \C
1573
1574
1575
1576
1577 This matches anything except for an identifier continuation character.
1578 This is the same as \[^\i\p{Mn}\p{Mc}\p{Nd}\x{200c}\x{200d}].
1579
1580 · \t Tab
1581
1582 · \n Newline
1583
1584 · \r Carriage return
1585
1586 · \b Backspace
1587
1588 · \a Alert
1589
1590 · \f Formfeed
1591
1592 · \e Escape
1593
1594 · \\ Backslash
1595
1596
1597
1599 Use Esc S to start an increment search forwards, or Esc R to start an
1600 incremental search backwards. As you type the search string, the cursor
1601 will jump to the first text that matches the regular expression you
1602 have entered so far.
1603
1604 Hit Esc S or Esc R again to find the next occurrence of the text or to
1605 switch the direction of the search.
1606
1607 ^S, ^\ and ^L have the same effect as Esc S. ^R has the same effect as
1608 Esc R. These keys are to support JMACS.
1609
1610 Hit Backspace to undo the last incremental search action. The last
1611 action could be a repeat of a previous search or the entering of a new
1612 character.
1613
1614 Use ^Q to insert control characters into the search text. Previously, `
1615 could also be used for this.
1616
1617 Hit any other key to exit the increment search.
1618
1620 Hit ^G to jump between matching delimiters. This works on both charac‐
1621 ter delimiters (like ´(´ and ´)´) and word delimiters for languages
1622 like Pascal and Verilog which use "begin" and "end" to delimit blocks.
1623 It also works for matching start and end tags in XML. If a word is not
1624 known, ^G starts a search with the word moved into the search prompt.
1625
1626 For ^G to work on word delimiters, the cursor must be positioned on the
1627 first letter of the word. So in XML, if the cursor is on the < in
1628 <foo>, it will jump to the >. But if it is one the ´f´, it will jump to
1629 the matching </foo>. Likewise, in C, ^G will jump between #if, #else
1630 and #endif, but you need to position the cursor on the letter, not the
1631 ´#´.
1632
1633 ^G is smart enough to skip delimiters found in quoted or commented-out
1634 matter. You need to tell JOE how your language indicates this: see the
1635 ftyperc file for examples of how this is done.
1636
1637 The are a number of options which control the behavior of ^G. These
1638 options control which kinds of comments ^G can skip over:
1639
1640 · c_comment
1641
1642 · cpp_comment
1643
1644 · pount_comment
1645
1646 · semi_comment
1647
1648 · vhdl_comment
1649
1650
1651
1652 These options determine which kinds of strings ^G can skip over:
1653
1654 · single_quoted
1655
1656 · double_quoted
1657
1658
1659
1660 This option allows an annotated syntax file to determine which text can
1661 be counted as comments or strings which can be skipped over by ^G:
1662
1663 · highlighter_context
1664
1665
1666
1667 This option enables the use of syntax files to identify comments and
1668 strings which should be skipped over during ^G matching. The syntax
1669 file states should be annotated with the string and comment keywords
1670 for this to work.
1671
1672 · text_delimiters
1673
1674
1675
1676 This option provides a list of word delimiters to match. For example,
1677 "begin=end:if=elif=else=endif" means that ^G will jump between the
1678 matching if, elif, else and endif. It will also jump between begin and
1679 end.
1680
1681 ^G has a built-in table for matching character delimiters- it knows
1682 that ( goes with ).
1683
1684 ^G has a built-in parser to handle start/end tag matching for XML.
1685
1687 If you want to move, copy, save or delete a specific section of text,
1688 you can do it with highlighted blocks. First, move the cursor to the
1689 start of the section of text you want to work on, and press ^K B. Then
1690 move the cursor to the character just after the end of the text you
1691 want to affect and press ^K K. The text between the ^K B and ^K K
1692 should become highlighted. Now you can move your cursor to someplace
1693 else in your document and press ^K M to move the highlighted text
1694 there.
1695 You can press ^K C to make a copy of the highlighted text and insert it
1696 to where the cursor is positioned. ^K Y to deletes the highlighted
1697 text. ^K W, writes the highlighted text to a file.
1698
1699 A very useful command is ^K /, which filters a block of text through a
1700 UNIX command. For example, if you select a list of words with ^K B and
1701 ^K K, and then type ^K / sort, the list of words will be sorted.
1702 Another useful UNIX command for ^K /, is tr. If you type ^K / tr a-z
1703 A-Z, then all of the letters in the highlighted block will be converted
1704 to uppercase.
1705
1706 How do I deselect a highlighted region?
1707 After you are finished with some region operations, you can just leave
1708 the highlighting on if you don´t mind it (but don´t accidentally hit ^K
1709 Y). If it really bothers you, however, just hit ^K B ^K K, to turn the
1710 highlighting off.
1711
1712 Beginning with JOE 4.2, you can hit ^C to cancel the region selection.
1713
1714 New ways of selecting regions
1715 The classic way is to hit ^K B at the beginning and ^K K at the end.
1716 These set pointers called markb and markk. Once these are set you can
1717 jump to markb with Esc B and jump to markk with Esc K.
1718
1719 New way: hit Ctrl-Right Arrow to start selecting rightward. Each time
1720 you hit Ctrl-Right Arrow, the block is extended one more to the right.
1721 This uses a simple macro: "begin_marking,rtarw,toggle_marking".
1722
1723 Unfortunately, there is no standard way to get the keysequence given by
1724 the terminal emulator when you hit Ctrl-Right Arrow. Instead you have
1725 to determine this sequence yourself and enter it directly in the joerc
1726 file. Some examples are given for Xterm and gnome-terminal. Hit ^Q
1727 Ctrl-Right Arrow within JOE to have the sequence shown on your screen.
1728 Note that Putty uses Esc Esc [ C which will not appear with ^Q Right
1729 Arrow (also Esc Esc is the set bookmark command, so you need to unbind
1730 it to do this in Putty).
1731
1732 Also you can hit Ctrl-Delete to cut and Ctrl-Insert to paste if the
1733 sequence for these keys are known.
1734
1735 The mouse can also be used to select text if mouse support is enabled
1736 in JOE.
1737
1739 Auto-indent mode is toggled with the ^T I command. The joerc file is
1740 normally set up so that files with names ending with .p, .c or .h have
1741 auto-indent mode enabled. When auto-indent mode is enabled and you hit
1742 Enter, the cursor will be placed in the same column that the first
1743 non-whitespace character was on in the original line.
1744
1745 You can use the ^K , and ^K . commands to shift a block of text to the
1746 left or right. If no highlighting is set when you give these commands,
1747 the program block (as indicated by indentation) that the cursor is
1748 located in will be selected, and will be moved by subsequent ^K , and
1749 ^K . commands.
1750
1751 The number of columns these commands shift by and the character used
1752 for shifting can be set through the istep and indentc options. These
1753 options are available in the ^T menu. Also, ^T = can be used to quickly
1754 select from a number of common values for indentation step and charac‐
1755 ter.
1756
1757 JOE has a number of additional options related to indenting programs:
1758
1759 · smartbacks
1760 Enable smart backspace and tab. When this mode is set Backspace and
1761 Tab indent or unindent based on the values of the istep and indentc
1762 options.
1763
1764
1765 · smarthome
1766 The Home and ^A keys first move the cursor to the beginning of the
1767 line, then if hit again, to the first non-blank character.
1768
1769
1770 · indentfirst
1771 Smart home goes to first non-blank character first, instead of
1772 going to the beginning of the line first.
1773
1774
1775 · purify
1776 Fix indentation if necessary before shifting or smart backspace.
1777 For example, if indentation uses a mix of tabs and spaces, and
1778 indentc is space, then indentation will be converted to all spaces
1779 before the shifting operation.
1780
1781
1782 · guess_indent
1783 When set, JOE tries to guess the indentation character and indenta‐
1784 tion step based on the contents of the file. The algorithm is to
1785 find the greatest common factor of the three most common indenta‐
1786 tions found in the file.
1787
1788
1789
1790
1792 Type ^T X to have ^K B and ^K K select rectangular blocks instead of
1793 stream-of-text blocks. This is also known as columnar mode. This mode
1794 is useful for moving, copying, deleting or saving columns of text. You
1795 can also filter columns of text with the ^K / command- if you want to
1796 sort a column, for example. The insert file command, ^K R is also
1797 affected.
1798
1799 When rectangle mode is selected, overtype mode is also useful (^T T).
1800 When overtype mode is selected, rectangles will replace existing text
1801 instead of getting inserted before it. Also the delete block command
1802 (^K Y) will clear the selected rectangle with Spaces and Tabs instead
1803 of deleting it. Overtype mode is especially useful for the filter block
1804 command (^K /), since it will maintain the original width of the
1805 selected column.
1806
1808 Use ^T P to enter or exit picture mode. Picture mode helps with ASCII
1809 drawings.
1810
1811 Picture mode controls how JOE handles the case where the cursor is past
1812 the ends of lines. This happens when you use the up or down arrow keys
1813 to move the cursor from the end of a long line to a short line.
1814
1815 If you attempt to type a character in this case:
1816
1817 If picture mode is off, the cursor will jump to the end of the line and
1818 insert it there.
1819
1820 If picture mode is on, the line is filled with spaces so that the char‐
1821 acter can be inserted at the cursor position.
1822
1824 You can edit more than one file at the same time or edit two or more
1825 different places of the same file. To do this, hit ^K O, to split the
1826 screen into two windows. Use ^K P or ^K N to move the cursor into the
1827 top window or the lower window. Use ^K E to edit a new file in one of
1828 the windows. A window will go away when you save the file with ^K X or
1829 abort the file with ^C. If you abort a file which exists in two win‐
1830 dows, one of the window goes away, not the file.
1831
1832 You can hit ^K O within a window to create even more windows. If you
1833 have too many windows on the screen, but you don´t want to eliminate
1834 them, you can hit ^K I. This will show only the window the cursor is
1835 in, or if there was only one window on the screen to begin with, try to
1836 fit all hidden windows on the screen. If there are more windows than
1837 can fit on the screen, you can hit ^K N on the bottom-most window or ^K
1838 P on the top-most window to get to them.
1839
1840 If you gave more than one file name to JOE on the command line, each
1841 file will be placed in a different window.
1842
1843 You can change the height of the windows with the ^K G and ^K T com‐
1844 mands.
1845
1846 Windowing system model
1847 JOE has an unusual model for its windowing system. Basically you have a
1848 ring of windows, but only a section of this ring may fit on the screen.
1849 The windows not on the screen still exist, they are just scrolled off.
1850 When you hit ^K N on the bottom window of the screen, it scrolls fur‐
1851 ther windows from the ring onto the screen, possibly letting the top
1852 window scroll out of view.
1853
1854 Native JOE tries to keep each loaded buffer in a window, so users can
1855 find all of the buffers by scrolling through the windows. The explode
1856 command (^K I) either expands all windows to the size of the screen so
1857 that only one window can fit on the screen, or shrinks them all as much
1858 as possible to fit many on the screen.
1859
1860 On the other hand, JOE supports "orphan" buffers- files loaded into the
1861 editor, but which are not in a window. ^C normally closes a window and
1862 discards the buffer that was in it. If you hit ^C on the last remaining
1863 window, it will normally exit the editor. However, if there are orphan
1864 buffers, ^C will instead load them into this final window to give you a
1865 chance to explicitly discard them. If the orphan option is given on the
1866 command line, as in joe -orphan *.c, then JOE only loads the first file
1867 into a window and leaves all the rest as orphans.
1868
1869 orphan also controls whether the edit command ^K E creates a new window
1870 for a newly loaded file, or reuses the current window (orphaning its
1871 previous occupant).
1872
1873 The bufed command prompts for a name of a buffer to switch into a win‐
1874 dow. Its completion list will show all buffers, including orphans and
1875 buffers which appear in other windows. Esc V and Esc U (nbuf and pbuf
1876 commands) allow you to cycle through all buffers within a single win‐
1877 dow.
1878
1879 Windows maintain a stack of occupants to support the pop-up shell win‐
1880 dow feature. When a pop-up window is dismissed, the previous buffer is
1881 returned to the window.
1882
1884 Scratch buffers are buffers which JOE does not worry about trying to
1885 preserve. JOE will not ask to save modified scratch buffers. Pop-up
1886 shell windows, the startup log and compile and grep message windows are
1887 scratch buffers. You can create your own scratch buffer with the
1888 scratch command.
1889
1890 The following commands load scratch buffers:
1891
1892 · showlog Show startup log
1893
1894 · mwind Show message window (compile / grep messages from Esc C and
1895 Esc G commands).
1896
1897
1898
1900 Macros allow you to record a series of keystrokes and replay them with
1901 the press of two keys. This is useful to automate repetitive tasks. To
1902 start a macro recording, hit ^K [ followed by a number from 0 to 9. The
1903 status line will display (Macro n recording...). Now, type in the
1904 series of keystrokes that you want to be able to repeat. The commands
1905 you type will have their usual effects. Hit ^K ] to stop recording the
1906 macro. Hit ^K followed by the number you recorded the macro in to exe‐
1907 cute one iteration of the key-strokes.
1908
1909 For example, if you want to put "**" in front of a number of lines, you
1910 can type:
1911
1912 ^K [ 0 ^A **down arrow\ ^K ]
1913
1914 Which starts the macro recording, moves the cursor to the beginning of
1915 the line, inserts "**", moves the cursor down one line, and then ends
1916 the recording. Since we included the key-strokes needed to position the
1917 cursor on the next line, we can repeatedly use this macro without hav‐
1918 ing to move the cursor ourselves, something you should always keep in
1919 mind when recording a macro.
1920
1921 Keyboard macro subroutines
1922 If you find that the macro you are recording itself has a repeated set
1923 of key-strokes in it, you can record a macro within the macro, as long
1924 as you use a different macro number. Also you can execute previously
1925 recorded macros from within new macros.
1926
1927 Query suspend
1928 If your macro includes a prompt for user input, and you want the user
1929 to fill in the prompt every time the macro is executed, hit ^K ? at the
1930 point in the macro recording where the user action is required. Key‐
1931 board input will not be recorded at this point. When the user completes
1932 the prompt, macro recording will continue.
1933
1934 When the macro is executed, the macro player will pause at the point
1935 where ^K ? was entered to allow user input. When the user completes the
1936 prompt, the player continues with the rest of the macro.
1937
1938 Repeat
1939 You can use the repeat command, ^K \, to repeat a macro, or any other
1940 edit command or even a normal character, a specified number of times.
1941 Hit ^K \, type in the number of times you want the command repeated and
1942 press Enter. The next edit command you now give will be repeated that
1943 many times. For example, to delete the next 20 lines of text, type:
1944
1945 ^K \ 20return^Y
1946
1948 A macro is a comma separated list of commands. When the macro is exe‐
1949 cuted, each command is executed until either the end of the list is
1950 reached, or one of the commands fails (non-zero return value from the
1951 command). Failed commands beep if you have beeps enabled (^T B).
1952
1953 Hit Esc D to insert the current set of keyboard macros as text into the
1954 current buffer. For example, the "**" insert macro above looks like
1955 this:
1956
1957
1958
1959 home,"**",dnarw ^K 0 Macro 0
1960
1961
1962
1963 You could insert this into your .joerc file and change the key sequence
1964 (the K 0) to something more permanent.
1965
1966 Define your own
1967 You can bind macros to key sequences or define your own named macros in
1968 the joerc file. For example, this will define a macro called foo:
1969
1970
1971
1972 :def foo eof,bol
1973
1974
1975
1976 foo will position the cursor at the beginning of the last line of the
1977 file. eof jumps to the end of the file. bol jumps to the beginning of a
1978 line. Once a macro has been named this way it will show up in the com‐
1979 pletion list of the Esc X command prompt.
1980
1981 Command prompt
1982 You can execute a macro directly by typing it into the command prompt.
1983 Hit Esc X to bring up the command prompt. Hit Tab at this prompt for a
1984 completion list of all available commands.
1985
1986 Here is a complete list of commands.
1987
1988 Macro don´t stop modifier
1989 Sometimes, you expect commands to sometimes fail, but want the rest of
1990 the commands in the list to be executed anyway. To mark a command which
1991 is allowed to fail, postfix it with ´!´. For example, here a macro
1992 which hits down page in the window above:
1993
1994
1995
1996 prevw,pgdn!,nextw
1997
1998
1999
2000 If prevw fails, the macro is aborted as usual. Even if pgdn fails
2001 (already at end of buffer), nextw will be executed so that the cursor
2002 is returned to the original window.
2003
2004 Macro repeat argument modifiers
2005 Repeat arguments can be specified with ^K \. When a command is executed
2006 with a repeat argument, it is repeatedly executed the specified number
2007 of times. If the repeat argument is negative, an opposite command (if
2008 one exists) is executed instead. For example, if you repeat "rtarw" -3
2009 times, "ltarw" will be repeated 3 times. If a negative argument is
2010 given for a command which does not have an opposite, the repeat argu‐
2011 ment is ignored.
2012
2013 Normally, if a repeat argument is specified for a macro, the macro is
2014 simply repeated the given number of times. If a negative argument is
2015 given, the argument is ignored.
2016
2017 Sometimes you want to allow negative arguments for macros and have
2018 their behavior modified. To do this, postfix each command within the
2019 macro which should be switched to its opposite for negative arguments
2020 with ´-´. For example, here is the page down other window macro:
2021
2022
2023
2024 prevw,pgdn-!,nextw
2025
2026
2027
2028 Now if you execute this with an argument of -2, it will be repeated
2029 twice, but pgup will be executed instead of pgdn. (note that several
2030 postfix modifiers can be placed after each command).
2031
2032 Sometimes when a repeat argument is given to macro, you want only one
2033 of the commands in the list to be repeated, not the entire macro. This
2034 can be indicated as follows:
2035
2036
2037
2038 prevw,pgdn#!,nextw
2039
2040
2041
2042 If this is executed with an argument of 2, prevw is executed once, pgdn
2043 is executed twice, and nextw is executed once.
2044
2045 Finally, even more complex semantics can be expressed with the "if"
2046 command:
2047
2048
2049
2050 if~,"arg<0",then,
2051 ltarw,
2052 else,
2053 rtarw,
2054 endif
2055
2056
2057
2058 When the macro is executed, the "arg" math variable is set to the given
2059 repeat argument. The "argset" variable is set to true if the user set
2060 an argument, even if it´s 1. If no argument was given, argset is false.
2061
2062 If any command in the list is postfixed with ~ (if above), the macro is
2063 not repeated, even if there is an argument. ´arg´ is still set to the
2064 given repeat count, however.
2065
2066 ´psh´/´query´ interaction
2067 The ´psh´ command saves the ^K B and ^K K positions on a stack. When
2068 the macro completes, (or when the ´pop´ command is called) the posi‐
2069 tions are restored.
2070
2071 The ´query´ command suspends macro execution until the current dialog
2072 is complete. It also suspends the automatic ´pop´ which happens at the
2073 end of a macro- so if the macro ends in a dialog you often want to call
2074 ´query´ to prevent the ^K B ^K K positions from being restored too
2075 early.
2076
2078 If you are editing a large C program with many source files, you can
2079 use the ctags program to generate a tags file. This file contains a
2080 list of program symbols and the files and positions where the symbols
2081 are defined.
2082
2083 First, create the tags file with the "ctags" program. For example:
2084
2085
2086
2087 ctags *.c *.h
2088
2089
2090
2091 This will create a file called "tags" in the current directory.
2092
2093 JOE looks for the "tags" file in the current directory. If there is
2094 none, it will try to open the file specified by the TAGS environment
2095 variable.
2096
2097 Paths in the tags file are always relative to location of the tags file
2098 itself.
2099
2100 The tags file contains a list of identifier definition locations in one
2101 of these formats:
2102
2103
2104
2105 identifier filename /search-expression/[;comments]
2106
2107 identifier filename ?search-expression?[;comments]
2108
2109 identifier filename line-number[;comments]
2110
2111
2112
2113 Some versions of ctags include class-names in the identifiers:
2114
2115
2116
2117 class::member
2118
2119
2120
2121 In this case, JOE will match on any of these strings:
2122
2123
2124
2125 member
2126 ::member
2127 class::member
2128
2129
2130
2131 Some versions of ctags include a filename in the identifier:
2132
2133
2134
2135 filename:identifier
2136
2137
2138
2139 In this case JOE will only find the identifier if the buffer name
2140 matches the filename.
2141
2142 The search-expression is a vi regular expression, but JOE only supports
2143 the following special characters:
2144
2145
2146
2147 ^ at the beginning means expression starts at beginning of line
2148
2149 $ at the end means expression ends at end of line
2150
2151 \x quote x (suppress meaning of /, ?, ^ or $)
2152
2153
2154
2155 Type ^K ; to bring up a tags search prompt. If the cursor had been on
2156 an identifier, the prompt is pre-loaded with it. Tab completion works
2157 in this prompt (it uses the tags file to find completions).
2158
2159 When you hit Enter, the tags search commences:
2160
2161 If there is one and only one match, JOE will jump directly to the defi‐
2162 nition.
2163
2164 If there are multiple matches, then the behavior is controlled by the
2165 notagsmenu option. If notagsmenu is enabled JOE jumps to the first def‐
2166 inition. If you hit ^K ; again before hitting any other keys, JOE jumps
2167 to the next definition, and so on. The "tagjump" command also performs
2168 this function.
2169
2170 If notagsmenu is disabled, JOE brings up a menu of all the matches. You
2171 select the one you want and JOE jumps to it. If you hit ^K ; again
2172 before hitting any other keys, the same menu re-appears with the cursor
2173 left in the original location.
2174
2175 You can hit ^K - to move the cursor back to the original location
2176 before the tags search (often ^C will work as well).
2177
2178 Since ^K ; loads the definition file into the current window, you prob‐
2179 ably want to split the window first with ^K O, to have both the origi‐
2180 nal file and the definition file loaded.
2181
2183 JOE has a built-in calculator which can be invoked with Esc M.
2184
2185 Math functions
2186 sin, cos, tan, exp, sqrt, cbrt, ln, log, asin, acos, atan, sinh, cosh,
2187 tanh, asinh, acosh, atanh, int, floor, ceil, abs, erf, erfc, j0, j1,
2188 y0, y1
2189
2190 Variables
2191 · e
2192 Set to ´e´
2193
2194
2195 · pi
2196 Set to ´pi´
2197
2198
2199 · top
2200 Set to line number of top window line
2201
2202
2203 · lines
2204 Set to number of lines in file
2205
2206
2207 · line
2208 Set to current line number
2209
2210
2211 · col
2212 Set to current column number
2213
2214
2215 · byte
2216 Set to current byte number
2217
2218
2219 · size
2220 Set to buffer size
2221
2222
2223 · height
2224 Set to window height
2225
2226
2227 · width
2228 Set to window width
2229
2230
2231 · char
2232 Set to ASCII val of character under cursor
2233
2234
2235 · markv
2236 True if there is a valid block set (^KB ... ^KK)
2237
2238
2239 · rdonly
2240 True if file is read-only
2241
2242
2243 · arg
2244 Current repeat argument
2245
2246
2247 · argset
2248 True if a repeat argument was given
2249
2250
2251 · is_shell
2252 True if executed in an active shell window
2253
2254
2255 · no_windows
2256 No. buffer windows on the screen
2257
2258
2259 · ans
2260 Result of previous expression
2261
2262
2263
2264
2265 Commands
2266 · hex
2267 Hex display mode
2268
2269
2270 · dec
2271 Decimal display mode
2272
2273
2274 · ins
2275 Insert ´ans´ into buffer
2276
2277
2278 · sum
2279 Sum of numbers in block
2280
2281
2282 · cnt
2283 Count numbers in block
2284
2285
2286 · avg
2287 Average value of numbers in block
2288
2289
2290 · dev
2291 Standard deviation of numbers in block
2292
2293
2294 · eval
2295 Evaluate math expressions in block (or whole file if no block set).
2296
2297
2298 · joe(...)
2299 Execute a JOE macro (argument in same format as joerc file macros).
2300 Return value of JOE macro is returned (for macro success, return
2301 true (non-zero)).
2302
2303
2304
2305
2306 For example:
2307
2308
2309
2310 joe(sys,"[ 1 == 1 ]",rtn)
2311
2312
2313
2314 ([ 1 == 1 ]) is a shell command. "[" is a synonym for the "test" UNIX
2315 command.
2316
2317 Returns true.
2318
2319 Remember: argument for JOE macro command "if" is a math expression. So
2320 for example, the macro:
2321
2322
2323
2324 if,"joe(sys,\"[ 1 == 1 ]\",rtn)",then,"TRUE",endif
2325
2326
2327
2328 Types TRUE into the buffer.
2329
2330 Operators:
2331 · !x
2332 Logical not of x.
2333
2334
2335 · x
2336 Raise x to power of y.
2337
2338
2339 · a*b
2340 Multiply.
2341
2342
2343 · a/b
2344 Divide.
2345
2346
2347 · a%b
2348 Modulus.
2349
2350
2351 · a+b
2352 Add.
2353
2354
2355 · a-b
2356 Subtract.
2357
2358
2359 · a<b
2360 True if a is less than b.
2361
2362
2363 · a<=b
2364 True if a is less than or equal to b.
2365
2366
2367 · a>b
2368 True if a is greater than b.
2369
2370
2371 · a>=b
2372 True if a is greater than or equal to b.
2373
2374
2375 · a==b
2376 True if a equals b.
2377
2378
2379 · a!=b
2380 True if a does not equal b.
2381
2382
2383 · a&&b
2384 True if both a and b are true.
2385
2386
2387 · a||b
2388 True if ether a or b are true.
2389
2390
2391 · a?b:c
2392 If a is true return b, otherwise return c.
2393
2394
2395 · a=b
2396 Assign b to a.
2397
2398
2399 · a:b
2400 Execute a, then execute b.
2401
2402
2403
2404
2405 &&, || and ? : work as in C and sh as far as side effects: if the
2406
2407 left side of && is false, the right side is not evaluated.
2408 is expression separator.
2409
2411 Hit ^K ´ to run a command shell in one of JOE´s windows. When the cur‐
2412 sor is at the end of a shell window (use ^K V if it´s not), whatever
2413 you type is passed to the shell instead of the buffer. Any output from
2414 the shell or from commands executed in the shell is appended to the
2415 shell window (the cursor will follow this output if it´s at the end of
2416 the shell window). This command is useful for recording the results of
2417 shell commands- for example the output of make, the result of grepping
2418 a set of files for a string, or directory listings from FTP sessions.
2419 Besides typeable characters, the keys ^C, Backspace, Del, Return and ^D
2420 are passed to the shell. Type the shell exit command to stop recording
2421 shell output. If you press ^C in a shell window, when the cursor is not
2422 at the end of the window, the shell is killed.
2423
2424 If you use Bash, you can hit: ^Q Up Arrow and ^Q Down Arrow to scroll
2425 through Bash´s history buffer. Other keys work as well: try ^Q ^A to go
2426 to beginning of line or ^Q ^E to go to end of line. Unfortunately JOE
2427 only emulates a dumb terminal, so you have to use a lot of imagination
2428 to do any editing beyond hitting backspace.
2429
2430 In general, any character quoted with ^Q is sent to the shell.
2431
2432 Also sent to the shell: Tab, Backspace, Enter, ^C and ^D.
2433
2435 Hit F1 - F4 to open and switch between shell windows.
2436
2437 Pop-up shell windows use a full terminal emulator so that when you type
2438 "man ls" it´s formatted correctly (it works well enough so that some
2439 interactive programs can be used). Even so, the shell window is still
2440 an edit buffer.
2441
2442 The old shell window (with no terminal emulation) still exists: use ^K
2443 ´ to invoke it as usual. This is useful to see control sequences emit‐
2444 ted by a program.
2445
2446 More of the keys get passed to the running program in pop-up shell win‐
2447 dows compared with the older one. There is a :vtshell section of the
2448 joerc file to control which ones. In particular arrow keys and Ctrl-C
2449 are passed to the program. It means you can easily step through bash
2450 history with the arrow keys, or abort programs the normal way with
2451 Ctrl-C.
2452
2453 On the other hand, loss of Ctrl-C means it´s less obvious how to close
2454 the window. One way is to move the cursor off of the shell data entry
2455 point (with Ctrl-P), and then hit Ctrl-C. Another is to hit ^K Q.
2456 Finally, you can type ´pop´ at the command prompt.
2457
2458 If you need to pass a key to the shell that JOE normally uses, quote
2459 it. For example, if you invoke "emacs -nw" in the shell window, you can
2460 exit it with:
2461
2462
2463
2464 ^Q ^X ^C
2465
2466
2467
2468 To quickly position the cursor back to the point where data is entered
2469 into the shell, hit ^K V.
2470
2471 When you open a shell window, a JOE-specific startup-script is sourced.
2472 It´s located in /etc/joe/shell.sh (also /etc/joe/shell.csh). It con‐
2473 tains some aliases which allow you to control JOE with fake shell com‐
2474 mands. I have these commands so far:
2475
2476 · clear
2477 erase shell window (delete buffer contents)
2478
2479
2480 · joe file
2481 edit a file in JOE
2482
2483
2484 · math 1+2
2485 evaluate equation using JOE´s calculator
2486
2487
2488 · cd xyz
2489 change directory, keep JOE up to date
2490
2491
2492 · markb
2493 same as ^KB
2494
2495
2496 · markk
2497 same as ^KK
2498
2499
2500 · mark command
2501 execute shell command, mark it´s output
2502
2503
2504 · parse command
2505 execute shell command, parse it´s output for file names and line
2506 numbers (for find or grep)
2507
2508
2509 · parser comman
2510 execute shell command, parse it´s output for errors (for gcc)
2511
2512
2513 · release
2514 release parsed errors
2515
2516
2517 · pop
2518 dismiss shell window (same as ^K Q)
2519
2520
2521
2522
2523 These work by emitting an escape sequence recognized by the terminal
2524 emulator: Esc { joe_macro }. When this is received, the macro is exe‐
2525 cuted. For security, only macros defined in the joerc file which begin
2526 with "shell_" can be executed this way.
2527
2528 Use cases
2529 Pop-up shell windows have a number of nice use cases:
2530
2531 · Use it to browse manual pages
2532
2533 Hit F1 and type "man fopen". Use ´b´ (´u´) and space to control
2534 more (or less) while viewing the manual. You can leave the manual
2535 on the screen in one window while editing in another window.
2536
2537 · Use it to switch directories
2538
2539 Hit F1 and navigate to the directory while using cd. Once you are
2540 in the right place, hit ^K E to load a file (or type "edit file"
2541 from the shell).
2542
2543 · Use it in conjunction with the error parser to find files
2544
2545 Hit F1 and navigate to a directory. Use grep or find (or both) to
2546 generate a list of files):
2547
2548
2549
2550
2551
2552 parse grep -n FIXME *.c
2553
2554
2555
2556 Or:
2557
2558
2559
2560 markb; find . | xargs grep -n FIXME; markk; parse
2561
2562
2563
2564 (Note that you can´t say this:
2565
2566
2567
2568 parse find . | xargs grep -n FIXME
2569
2570
2571
2572 ...the issue is that only the words to the left of the pipe symbol are
2573 passed as arguments to the parse command).
2574
2575 Now use ^P to position the cursor on one of the lines of the list. Hit
2576 Esc Space to have JOE edit the file and jump to the specified line
2577 (also you can use Esc - and Esc = to step through the list).
2578
2579 · Use it in conjunction with search and replace to edit many files
2580
2581 Once JOE has a list of files (from above), use search and replace
2582 with the ´e´ option to visit all of them:
2583
2584
2585
2586
2587
2588 ^K F
2589 Find: <text>
2590 Options: re
2591 Replace: <replacement text>
2592
2593
2594
2595 · Build your project
2596
2597
2598
2599 Easily capture errors from a build with:
2600
2601
2602
2603 parserr make
2604
2605
2606
2607 Hit Esc = and Esc - to step through the errors.
2608
2609 How it works..
2610 · There is a new mode "ansi". (Esc X mode ansi). When this mode is
2611 enabled, the screen updater hides escape sequences which are in the
2612 buffer. Otherwise you get a big mess from the sequences surrounding
2613 colored output from ´ls´.
2614
2615 · There is a new built-in syntax: "ansi". (^T Y ansi). This syntax
2616 parses the ANSI color control sequences so that text gets colored.
2617
2618 · There is a terminal emulator to interpret control sequences from
2619 the shell program. It emulates a terminal by modifying the contents
2620 of an edit buffer.
2621
2622 · When the edit window is resized we tell the shell by issuing the
2623 TIOCSSIZE or TIOCSWINSZ ioctl. This way, the program running in the
2624 shell knows the window size.
2625
2626
2627
2629 JOE has two parsers which can be used to generate the error list (list
2630 of file names / line numbers).
2631
2632 The "parserr" command parses the entire buffer, or if the block is set,
2633 just the highighted block for compiler error messages. The messages
2634 should be in this format:
2635
2636
2637
2638 <junk> file.name <junk> line-number <junk> : <junk>
2639
2640
2641
2642 The file name needs to be made of numbers, letters, ´/´, ´.´ and ´-´.
2643 It must have at leat one ´.´ in it. There needs to be a colon somewhere
2644 after the line number. Lines not in this format are ignored.
2645
2646 The "gparse´ command parses the entire buffer, or if the block is set,
2647 just the highlighted block for a list of filenames or filenames with
2648 line numbers from "grep -n", "find" and similar programs.
2649
2650
2651
2652 filename
2653
2654 filename:<junk>
2655
2656 filename:line-number:<junk>
2657
2658
2659
2660 Once JOE has the error list, there are a number of things you can do
2661 with it:
2662
2663 · Visit the files/locations in the list with Esc - and Esc =
2664
2665 · Search and replace across all files in the list by using the ´e´
2666 search and replace option.
2667
2668 · Clear the list by using the "release" command.
2669
2670
2671
2672 Also, you can use Esc Space (´jump´ command) to parse the line the cur‐
2673 sor is on and jump to the parsed filename and line number. ´jump´ uses
2674 the grep/find parser unless ´parserr´ had been previously issued in the
2675 buffer.
2676
2677 Grep-find
2678 Hit Esc G to bring up the prompt. Enter a command which results in file
2679 names with line numbers, for example: ´grep -n fred *.c´. This will
2680 list all instances of ´fred´ in the *.c files. You need the ´-n´ to get
2681 the line numbers.
2682
2683 Now you can hit Esc Space on one of the lines to jump to the selected
2684 file. Also, you can use Esc = and Esc - to step through each line.
2685
2686 Compile
2687 Hit Esc C to save all modified files and then bring up the compile
2688 prompt. Enter the command you want to use for the compiler (typically
2689 "make -w"). The compiler will run in a shell window. When it´s com‐
2690 plete, the results are parsed.
2691
2692 The ´-w´ flag should be given to "make" so that it prints messages
2693 whenever it changes directories. The message are in this format:
2694
2695
2696
2697 make[1]: Entering directory `/home/jhallen/joe-editor-mercurial/joe´
2698
2699
2700
2701 If there are any errors or warnings from the compiler you can hit Esc
2702 Space on one of the lines to jump to the selected file. Also, you can
2703 use Esc = and Esc - to step through each line.
2704
2706 To enable highlight use ^T H.
2707
2708 To select the syntax, use ^T Y. You can hit Tab Tab at the prompt for a
2709 completion list.
2710
2711 JOE tries to determine the syntax to use based on the name and contents
2712 of the file. The configuration file /etc/joe/ftyperc contains the defi‐
2713 nitions.
2714
2715 Each syntax is defined by a file located /usr/share/joe/syntax/.
2716
2718 from c.jsf http://joe-editor.hg.sourceforge.net/hgweb/joe-edi‐
2719 tor/joe-editor/file/tip/syntax/c.jsf.in, slightly modified
2720
2721 A deterministic state machine that performs lexical analysis of the
2722 target language is provided in a syntax file. (This is the "assembly
2723 language" of syntax highlighting. A separate program could in principal
2724 be used to convert a regular expression NFA syntax into this format).
2725
2726 Each state begins with:
2727
2728
2729
2730 :<name> <color-name> <context>
2731
2732
2733
2734 name\ is the state´s name.
2735
2736 color-name\ is the color used for characters eaten by the state (really
2737 a symbol for a user definable color).
2738
2739 context\ tells JOE if the current character is part of a comment or a
2740 string. This allows JOE to skip over comments and strings when matching
2741 characters such as parentheses. To use this feature, the high‐
2742 lighter_context option must be applied to the files highlighted by the
2743 corresponding syntax. To apply the option, add it to ftyperc for those
2744 file entries.
2745
2746 The valid contexts are:
2747
2748 · comment This character is part of a comment. Example: /* comment */
2749
2750 · string This character is part of a string. Examples: "string" ´c´
2751 ´string´
2752
2753
2754
2755 The comment and string delimiters themselves should be marked with the
2756 appropriate context. The context is considered to be part of the color,
2757 so the recolor=-N and recolormark options apply the context to previous
2758 characters.
2759
2760 The first state defined is the initial state.
2761
2762 Within a state, define transitions (jumps) to other states. Each jump
2763 has the form:
2764
2765
2766
2767 <character-list> <target-state-name> [<option>s]
2768
2769
2770
2771 There are three ways to specify character-list\s, either * for any
2772 character not otherwise specified, % or & to match the character in the
2773 delimiter match buffer (% matches the saved character exactly, while &
2774 matches the opposite character, for example ( will match ) when & is
2775 used) or a literal list of characters within quotes (ranges and escape
2776 sequences allowed: see Escape Sequences). When the next character
2777 matches any in the list, a jump to the target-state is taken and the
2778 character is eaten (we advance to the next character of the file to be
2779 colored).
2780
2781 The * transition should be the first transition specified in the state.
2782
2783 There are several options:
2784
2785 · noeat - Do not eat the character, instead feed it to the next state
2786 (this tends to make the states smaller, but be careful: you can
2787 make infinite loops). ´noeat´ implies ´recolor=-1´.
2788
2789 · recolor=-N - Recolor the past N characters with the color of the
2790 target-state. For example once /* is recognized as the start of C
2791 comment, you want to color the /* with the C comment color with
2792 recolor=-2.
2793
2794 · mark - Mark beginning of a region with current position.
2795
2796 · markend - Mark end of region.
2797
2798 · recolormark - Recolor all of the characters in the marked region
2799 with the color of the target-state. If markend is not given, all of
2800 the characters up to the current position are recolored. Note that
2801 the marked region can not cross line boundaries and must be on the
2802 same line as recolormark.
2803
2804 · buffer - Start copying characters to a string buffer, beginning
2805 with this one (it´s OK to not terminate buffering with a matching
2806 ´strings´, ´istrings´ or ´hold´ option- the buffer is limited to
2807 leading 23 characters).
2808
2809 · save_c - Save character in delimiter match buffer.
2810
2811 · save_s - Copy string buffer to delimiter match buffer.
2812
2813 · strings - A list of strings follows. If the buffer matches any of
2814 the given strings, a jump to the target-state in the string list is
2815 taken instead of the normal jump.
2816
2817 · istrings - Same as strings, but case is ignored. Note: strings and
2818 istrings should be the last option on the line. They cause any
2819 options which follow them to be ignored.
2820
2821 · hold - Stop buffering string- a future ´strings´ or ´istrings´ will
2822 look at contents of buffer at this point. Useful for distinguishing
2823 commands and function calls in some languages ´write 7´ is a com‐
2824 mand ´write (´ is a function call- hold lets us stop at the space
2825 and delay the string lookup until the ( or 7.
2826
2827
2828
2829 The format of the string list is:
2830
2831
2832
2833 "string" <target-state> [<options>s]
2834 "string" <target-state> [<options>s]
2835 "&" <target-state> [<options>s] # matches contents of delimiter match buffer
2836 done
2837
2838
2839
2840 (all of the options above are allowed except "strings", "istrings" and
2841 "noeat". noeat is always implied after a matched string).
2842
2843 Weirdness: only states have colors, not transitions. This means that
2844 you sometimes have to make dummy states with
2845
2846
2847
2848 * <next-state> noeat
2849
2850
2851
2852 just to get a color specification.
2853
2854 Delimiter match buffer is for perl and shell: a regex in perl can be
2855 s<..>(...) and in shell you can say: <<EOS ....... EOS. The idea is
2856 that you capture the first delimiter into the match buffer (the < or
2857 first "EOS") and then match it to the second one with "&" in a string
2858 or character list.
2859
2860 Subroutines
2861 Highlighter state machines can now make subroutine calls. This works by
2862 template instantiation: the called state machine is included in your
2863 current state machine, but is modified so that the return address
2864 points to the called. There is still no run-time stack (the state is
2865 represented as a single integer plus the saved delimiter string).
2866
2867 Recursion is allowed, but is self limited to 5 levels.
2868
2869 Note: this recursion limit is obsolete. Subroutines now do use a stack
2870 so the call-depth is limitless.
2871
2872 To call a subroutine, use the ´call´ option:
2873
2874
2875
2876 "\"" fred call=string(dquote)
2877
2878
2879
2880 The subroutine called ´string´ is called and the jump to ´fred´ is
2881 ignored. The ´dquote´ option is passed to the subroutine.
2882
2883 If you use recolor along with call, the color used is that of the first
2884 state of the subroutine.
2885
2886 The subroutine itself returns to the caller like this:
2887
2888
2889
2890 "\"" whatever return
2891
2892
2893
2894 If we´re in a subroutine, it returns to the target state of the call
2895 ("fred" in the above example). If we´re not in a subroutine, it jumps
2896 to "whatever".
2897
2898 If you use recolor along with return, the color used is from the
2899 returned state ("fred" in the example above).
2900
2901 There are several ways of delimiting subroutines which show up in how
2902 it is called. Here are the options:
2903
2904 · call=string() - A file called string.jsf is the subroutine. The
2905 entire file is the subroutine. The starting point is the first
2906 state in the file.
2907
2908 · call=library.string() - A file called library.jsf has the subrou‐
2909 tine. The subroutine within the file is called string.
2910
2911 · call=.string() - There is a subroutine called string in the current
2912 file.
2913
2914
2915
2916 When a subroutine is within a file, but is not the whole file, it is
2917 delimited as follows:
2918
2919
2920
2921 .subr string
2922
2923
2924
2925
2926
2927 Option flags can be passed to subroutines which control preproces‐
2928 sor-like directives. For example:
2929
2930
2931
2932 .ifdef dquote
2933 "\"" idle return
2934 "´" idle return
2935
2936
2937
2938 .else is also available. .ifdefs can be nested.
2939
2941 ^T options, the help screens and the key-sequence to editor command
2942 bindings are all defined in JOE´s initialization file. If you make a
2943 copy of this file (which normally resides in /etc/joe/joerc) to
2944 $HOME/.joerc, you can customize these setting to your liking. The syn‐
2945 tax of the initialization file should be fairly obvious and there are
2946 further instructions in it.
2947
2948 The joerc file has a directive to include another file (:include). This
2949 facility is used to include a file called ftyperc (usually located in
2950 /etc/joe/ftyperc). ftyperc has the file type table which determines
2951 which local options (including syntax for the highlighter) are applied
2952 to each file type.
2953
2954 Initialization file loading sequence
2955 If the path for an initialization file begins with ´/´ (you can specify
2956 this with the include directive), JOE only tries to load it from the
2957 absolute path. Otherwise, JOE tries to load initialization files (the
2958 joerc file and any files included in it, typically ftyperc) from three
2959 places:
2960
2961 · "$HOME/.joerc" - The user´s personalized joerc file.
2962
2963 · "/etc/joe/joerc" - The system´s joerc file. The exact path is fixed
2964 during the build, and is determined by the --sysconfdir configure
2965 script option.
2966
2967 · "*joerc" - Built-in file This means JOE searches for the file in a
2968 table of files linked in with the JOE binary (they are in the
2969 builtins.c file). A built-in joerc file is provided so that the
2970 editor will run in cases where system´s joerc is inaccessible.
2971
2972
2973
2974 If the system´s joerc file is newer than the user´s joerc file, JOE
2975 will print a warning in the startup log. Previous versions of JOE would
2976 prompt the user for this case- the idea was that JOE may be unusable
2977 with an out of date initialization file.
2978
2979 joerc file sections
2980 The joerc file is broken up into a number of sections:
2981
2982 · Global options Options which are not file specific, like noxon.
2983
2984 · File name and content dependent options Options which depend on the
2985 file type, such as autoindent. The ftyperc file is included in this
2986 section.
2987
2988 · ^T menu system definition Use :defmenu to define a named menu of
2989 macros. The menu command brings up a specific named menu. ^T is a
2990 macro which brings up the root menu: menu,"root",rtn.
2991
2992 · Help screen contents Each help screen is named. The name is used to
2993 implement context dependent help.
2994
2995 · Key bindings Key binding tables are defined. You can define as many
2996 as you like (you can switch to a specific one with the keymap com‐
2997 mand), but the following must be provided:
2998
2999 · main Editing windows
3000
3001 · prompt Prompt windows
3002
3003 · query Single-character query prompts
3004
3005 · querya Single-character query for quote
3006
3007 · querysr Single-character query for search and replace
3008
3009 · shell Shell windows
3010
3011 · vtshell Terminal emulator shell windows
3012
3013
3014
3015
3016
3017
3018 Key binding tables can inherit bindings from already defined tables.
3019 This allows you to group common key bindings into a single table which
3020 is inherited by the others.
3021
3022 Mode command
3023 Many options can be controlled with the ^T menu. This menu is defined
3024 in the joerc file. Each option in the ^T menu just executes a macro.
3025 Usually the macro is the mode command. You can execute the mode command
3026 directly with:
3027
3028
3029
3030 Esc X mode <enter>
3031
3032
3033
3034 Hit Tab Tab for a completion list of all options.
3035
3036 Menu command
3037 This command calls up a named menu of macros which was defined in the
3038 joerc file.
3039
3040
3041
3042 Esc X menu <enter>
3043
3044
3045
3046 As usual, hit Tab Tab at the prompt for a completion list of the menus
3047 which exist.
3048
3049 ^T is bound to the simple macro menu,"root",rtn- it brings up the root
3050 of the options menu system.
3051
3053 There are two levels of mouse support. The -mouse option enables the
3054 first level, which will work with any stock Xterm. If -joexterm is also
3055 set, mouse support is enhanced, but you need a recent version of XTerm,
3056 and it needs to be ./configured with the --enable-paste64 option.
3057
3058 When -mouse is set, you can:
3059
3060 · Left-click in a text window to set the cursor position. Left-click
3061 in a different window to move the cursor to a different window.
3062
3063 · Select text with the mouse. Left-click and drag to select some
3064 text- it will be as if you had used ^K B and ^K K to mark it.
3065 Left-click (but don´t drag) to position the cursor somewhere else.
3066 Middle click to copy the selected text to the cursor- it will be as
3067 if you had hit ^K C. If you drag past the edge of the text window,
3068 the window will auto-scroll to select more text. Unfortunately,
3069 Xterm does not send any codes when the cursor is outside of the
3070 Xterm frame itself, so this only works if the mouse is still con‐
3071 tained within the Xterm frame. I´ve sent a patch to the Xterm main‐
3072 tainer to improve this, but he has not taken it yet.
3073
3074 · Resize windows with the mouse: click and hold on a status line
3075 dividing two windows to move it.
3076
3077 · Select menu entries (such as any completion menu or the ^T options
3078 menu): click on the menu item to position the cursor on it. Dou‐
3079 ble-click on a menu item to select it (same as hitting return with
3080 cursor on it).
3081
3082 · If your mouse has a wheel, turning the wheel will scroll the window
3083 with the cursor.
3084
3085
3086
3087 Unfortunately, when -mouse is selected, cut and paste between X windows
3088 does not work as it normally does in a shell window (left-click and
3089 drag to select, middle click to paste). Instead, you have to hold the
3090 shift key down to do this: shift-left-click and drag to select, and
3091 shift-middle click to paste. Note that pasting text into JOE this way
3092 has problems: any ` characters will get messed up because ` means quote
3093 the following control character. Also if auto-indent is enabled, pasted
3094 text will not be indented properly.
3095
3096 Note: these problems with pasting have been resolved in recent versions
3097 of JOE.
3098
3099 · JOE enables "bracketed paste" mode in Xterm so that pasted text is
3100 bracketed with an escape sequence. This sequence causes JOE to dis‐
3101 able the autoindent, wordwrap and spaces modes for the paste, and
3102 restores them when the paste is complete.
3103
3104 · Even if the terminal emulator does not have this bracketed paste
3105 mode, JOE detects pasted text by timing: If text arrives all at
3106 once (all in the same buffer), the text is assumed to be pasted
3107 text and autoindent and wordwrap are temporarily disabled.
3108
3109
3110
3111 When -joexterm is set (and you have ./configured Xterm with
3112 --enable-paste64):
3113
3114 · Cut & paste are properly integrated with X. Text selected with
3115 left-click-drag is available for pasting into other X windows (even
3116 if the selected text is larger than the text window). Text selected
3117 in other X windows can be pasted into JOE with middle-click. There
3118 are no problems pasting text containing ` or with auto-indent.
3119
3120
3121
3122 --enable-paste64 allows an application program to communicate Base-64
3123 encoded selection data to and from the Xterm. The program has full con‐
3124 trol over what is in the selection data and when it is received or
3125 sent.
3126
3128 JOE can make use of monochrome Xterm, 8-color Xterm, 16-color Xterm,
3129 88-color Xterm and 256-color Xterm. The number of colors which Xterm
3130 supports is determined by which "configure" script options are set
3131 before the Xterm source code is compiled. The termcap or terminfo entry
3132 must support how your Xterm is configured. On my Slackware Linux dis‐
3133 tribution, you have to set the TERM environment variable to one of
3134 these:
3135
3136 · xterm
3137
3138 · xterm-color
3139
3140 · xterm-16color
3141
3142 · xterm-88color
3143
3144 · xterm-256color
3145
3146
3147
3148 If the termcap/terminfo entry is missing, you can add the
3149 "-assume_256color" option to the joerc file. Note that this was broken
3150 for terminfo in versions of JOE below 3.4.
3151
3152 When it is working, the command: "joe -assume_256color -text_color
3153 bg_222" should have a gray background.
3154
3156 When this mode is selected (either put -hex on the command line, or
3157 look for "Hex edit mode" after hitting ^T), the buffer is displayed as
3158 a hex dump, but all of the editing commands operate the same way. It is
3159 most useful to select overtype mode in conjunction with hex dump (hit
3160 ^T T). Then typing will not insert.
3161
3162 · To enter the hex byte 0xF8 type ^Q x F 8
3163
3164 · You can use ^K C to copy a block as usual. If overtype mode is
3165 selected, the block will overwrite the destination data without
3166 changing the size of the file. Otherwise it inserts.
3167
3168 · Hit Esc X byte <Enter>, to jump to a particular byte offset. Hex
3169 values can be entered into this prompt like this: 0x2000.
3170
3171 · Search, incremental search, and search & replace all operate as
3172 usual.
3173
3174
3175
3177 For JOE to operate correctly, a number of other environment settings
3178 must be correct. The throughput (baud rate) of the connection between
3179 the computer and your terminal must be set correctly for JOE to update
3180 the screen smoothly and allow typeahead to defer the screen update. Use
3181 the stty nnn command to set this. You want to set it as close as possi‐
3182 ble to actual throughput of the connection. For example, if you are
3183 connected via a 1200 baud modem, you want to use this value for stty.
3184 If you are connected via 14.4k modem, but the terminal server you are
3185 connected to connects to the computer a 9600 baud, you want to set your
3186 speed as 9600 baud. The special baud rate of 38400 or extb is used to
3187 indicate that you have a very-high speed connection, such as a memory
3188 mapped console or an X-window terminal emulator. If you can´t use stty
3189 to set the actual throughput (perhaps because of a modem communicating
3190 with the computer at a different rate than it´s communicating over the
3191 phone line), you can put a numeric value in the BAUD environment vari‐
3192 able instead (use setenv BAUD 9600 for csh or BAUD=9600; export BAUD
3193 for sh).
3194
3195 The TERM environment variable must be set to the type of terminal
3196 you´re using. If the size (number of lines/columns) of your terminal is
3197 different from what is reported in the TERMCAP or TERMINFO entry, you
3198 can set this with the stty rows nn cols nn command, or by setting the
3199 LINES and COLUMNS environment variables. The terminal size is variable
3200 on modern systems and is determined by an ioctl, so these parameters
3201 often have no effect.
3202
3203 JOE normally expects that flow control between the computer and your
3204 terminal to use ^S/^Q handshaking (i.e., if the computer is sending
3205 characters too fast for your terminal, your terminal sends ^S to stop
3206 the output and ^Q to restart it). If the flow control uses out-of-band
3207 or hardware handshaking or if your terminal is fast enough to always
3208 keep up with the computer output and you wish to map ^S/^Q to edit com‐
3209 mands, you can set the environment variable NOXON to have JOE attempt
3210 to turn off ^S/^Q handshaking. If the connection between the computer
3211 and your terminal uses no handshaking and your terminal is not fast
3212 enough to keep up with the output of the computer, you can set the
3213 environment variable DOPADDING to have JOE slow down the output by
3214 interspersing PAD characters between the terminal screen update
3215 sequences.
3216
3217 Here is a complete list of the environment variables:
3218
3219 · BAUD
3220 Tell JOE the baud rate of the terminal (overrides value reported by
3221 stty).
3222
3223
3224 · COLUMNS
3225 Set number of columns in terminal emulator (in case termcap entry
3226 is wrong). This is only useful on old system which don´t have the
3227 "get window size" ioctl.
3228
3229
3230 · DOPADDING
3231 Enable JOE to send padding NULs to the terminal when set (for very
3232 old terminals).
3233
3234
3235 · HOME
3236 Used to get path to home directory for ~ expansion and also to find
3237 ~/.joerc file ~/.joe directory.
3238
3239
3240 · HOSTNAME
3241 Used to get hostname to put in EMACS compatible locks.
3242
3243
3244 · JOETERM
3245 Gives terminal type: JOE will use this instead of TERM if it´s set.
3246
3247
3248 · LANG
3249 Sets locale (like en_US.utf-8). JOE uses the first of these which
3250 is set: LC_ALL, LC_CTYPE, LANG.
3251
3252
3253 · LC_ALL
3254 Sets locale (like en_US.utf-8). JOE uses the first of these which
3255 is set: LC_ALL, LC_CTYPE, LANG.
3256
3257
3258 · LC_CTYPE
3259 Sets locale (like en_US.utf-8). JOE uses the first of these which
3260 is set: LC_ALL, LC_CTYPE, LANG.
3261
3262
3263 · LINES
3264 Set number of lines in terminal emulator (in case termcap entry is
3265 wrong). This is only useful on old system which don´t have the "get
3266 window size" ioctl.
3267
3268
3269 · NOXON
3270 Disable ^S and ^Q flow control, possibly allowing ^S and ^Q to be
3271 used as editor keys.
3272
3273
3274 · SHELL
3275 Path to shell (like /bin/sh). This is used in several places: If
3276 you are on a system with no job control, this shell is invoked when
3277 you hit ^K Z. Also this is the shell which is run in shell windows.
3278 If SHELL is not set (Cygwin) or if it´s set to /bin/sh, JOE invokes
3279 the first of these which exists: /bin/bash, /usr/bin/bash, /bin/sh.
3280
3281
3282 · SIMPLE_BACKUP_SUFFIX
3283 If this is set, it is appended to the file name instead of ~ to
3284 create the backup file name.
3285
3286
3287 · TAGS
3288 If set to a path to a file, JOE tries to use this as the "tags"
3289 file if there is no "tags" file in the current directory.
3290
3291
3292 · TEMP
3293 If set, gives path to directory to open swapfile instead of /tmp
3294
3295
3296 · TERMCAP
3297 Used by JOE´s built-in termcap file parser (not used for terminfo).
3298 A termcap entry can be placed directly in this variable (which will
3299 be used if it matches TERM), or if it begins with /, it gives a
3300 list of paths to termcap files to search.
3301
3302
3303 · TERMPATH
3304 Gives list of paths to termcap files to search when TERMCAP has a
3305 termcap entry (otherwise it´s ignored). The default list of paths
3306 to termcap files (when TERMCAP and TERMPATH do not have it) is:
3307 "~/.termcap /etc/joe/termcap /etc/termcap"
3308
3309
3310 · TERM
3311 Gives terminal type, like "vt100" or "xterm".
3312
3313
3314 · USER
3315 Used to get user name for EMACS compatible file locks.
3316
3317
3318
3319
3321 These commands can be entered at the Esc X prompt.
3322
3323 Background programs
3324 · bknd
3325 Run a shell in a window
3326
3327
3328 · vtbknd
3329 Run a shell in a terminal emulator window
3330
3331
3332 · killproc
3333 Kill program in current window
3334
3335
3336 · run
3337 Run a UNIX command in a window
3338
3339
3340 · sys
3341 Run a UNIX command and return to editor when done (I/O does not go
3342 through editor, but we get the command´s return status).
3343
3344
3345
3346 Blocks
3347 · blkcpy
3348 Copy marked block to cursor
3349
3350
3351 · blkdel
3352 Delete marked block
3353
3354
3355 · blkmove
3356 Move marked block to cursor
3357
3358
3359 · blksave
3360 Save marked block into a file
3361
3362
3363 · copy
3364 Copy block to kill-ring
3365
3366
3367 · drop
3368 Set markb. If it was already set, eliminate Ait.
3369
3370
3371 · dropon
3372 Set markb. If it was already set, eliminate it. Turn on marking
3373 mode.
3374
3375
3376 · toggle_marking
3377 If we´re in a block: clear markb and markk. If marking is off: set
3378 markb and turn on marking. If marking is on: set markk (swap if
3379 necessary with markb) and turn marking off.
3380
3381
3382 · begin_marking
3383 If we´re on an edge of a block: set markb to other edge and turn on
3384 marking mode. Otherwise set markb to cursor and turn on marking
3385 mode.
3386
3387
3388 · select
3389 Set markb. If it was already set, do nothing.
3390
3391
3392 · filt
3393 Filter block or file through a UNIX command
3394
3395
3396 · markb
3397 Set beginning of block mark
3398
3399
3400 · markk
3401 Set end of block mark
3402
3403
3404 · markl
3405 Mark current line
3406
3407
3408 · nmark
3409 Eliminate markb and markk
3410
3411
3412 · picokill
3413 Delete line or block
3414
3415
3416 · pop
3417 Restore markb and markk values from stack
3418
3419
3420 · psh
3421 Push markb and markk values onto a stack
3422
3423
3424 · swap
3425 Switch cursor with markb
3426
3427
3428 · tomarkb
3429 Move cursor to markb
3430
3431
3432 · tomarkbk
3433 Move cursor to markb or markk
3434
3435
3436 · tomarkk
3437 Move cursor to markk
3438
3439
3440 · yank
3441 Insert top of kill ring
3442
3443
3444 · yankpop
3445 Scroll through kill ring
3446
3447
3448 · yapp
3449 Append next kill to top of kill ring
3450
3451
3452 · upper
3453 Convert everything in block to uppercase
3454
3455
3456 · lower
3457 Convert everything in block to lowercase
3458
3459
3460
3461 Buffers
3462 · bufed
3463 Buffer menu
3464
3465
3466 · edit
3467 Load file into window: asks to reload if buffer exists
3468
3469
3470 · switch
3471 Load file into window: always uses buffer if it exists
3472
3473
3474 · scratch
3475 Push a scratch buffer into current window
3476
3477
3478 · popabort
3479 Abort and pop window from stack (do nothing if stack empty)
3480
3481
3482 · nbuf
3483 Load next buffer into current window
3484
3485
3486 · pbuf
3487 Load previous buffer into current window
3488
3489
3490 · reload
3491 Re-read file into buffer (revert)
3492
3493
3494 · reloadall
3495 Re-read all unmodified buffers
3496
3497
3498
3499 Cursor Motion
3500 · bof
3501 Move cursor to beginning of file
3502
3503
3504 · bol
3505 Move cursor to beginning of line (always)
3506
3507
3508 · bop
3509 Move to beginning of a paragraph
3510
3511
3512 · bos
3513 Move to beginning of screen
3514
3515
3516 · bkwdc
3517 Search backwards for a character
3518
3519
3520 · byte
3521 Move cursor to specific byte offset into the file.
3522
3523
3524 · col
3525 Move cursor to specific column number.
3526
3527
3528 · dnarw
3529 Move cursor down one line
3530
3531
3532 · eof
3533 Move cursor to end of file
3534
3535
3536 · eol
3537 Move cursor to end of line
3538
3539
3540 · eop
3541 Move cursor to end of paragraph
3542
3543
3544 · fwrdc
3545 Search forward for matching character
3546
3547
3548 · gomark
3549 Move cursor to a bookmark
3550
3551
3552 · home
3553 Move cursor to beginning of line
3554
3555
3556 · line
3557 Move cursor to specified line
3558
3559
3560 · ltarw
3561 Move cursor left
3562
3563
3564 · nedge
3565 Move cursor to next edge
3566
3567
3568 · nextpos
3569 Move cursor to next position in cursor position history
3570
3571
3572 · nextword
3573 Move cursor to end of next word
3574
3575
3576 · pedge
3577 Move cursor to previous edge
3578
3579
3580 · prevpos
3581 Move cursor to previous position in cursor position history
3582
3583
3584 · prevword
3585 Move cursor to beginning of previous word
3586
3587
3588 · rtarw
3589 Move cursor right
3590
3591
3592 · setmark
3593 Set a bookmark
3594
3595
3596 · tomatch
3597 Move cursor to matching delimiter
3598
3599
3600 · tos
3601 Move cursor to top of screen
3602
3603
3604 · uparw
3605 Move cursor up
3606
3607
3608
3609 Deletion
3610 · backs
3611 Backspace
3612
3613
3614 · backw
3615 Backspace a word
3616
3617
3618 · delbol
3619 Delete to beginning of line
3620
3621
3622 · delch
3623 Delete character under cursor
3624
3625
3626 · deleol
3627 Delete to end of line
3628
3629
3630 · dellin
3631 Delete entire line
3632
3633
3634 · delw
3635 Delete word to right
3636
3637
3638
3639 Error parsing
3640 · nxterr
3641 Goto next parsed error
3642
3643
3644 · parserr
3645 Parse errors in current file
3646
3647
3648 · gparse
3649 Parse grep list in current file
3650
3651
3652 · jump
3653 Parse current line and jump to it
3654
3655
3656 · prverr
3657 Go to previous parsed error
3658
3659
3660 · showerr
3661 Show current message
3662
3663
3664 · grep
3665 Execute grep command, parse when done
3666
3667
3668 · build
3669 Execute build command, parse when done
3670
3671
3672 · release
3673 Release error/grep records
3674
3675
3676
3677 Exit
3678 · cancel
3679 Like abort, but doesn´t return failure: useful in macros to escape
3680 out of a prompt.
3681
3682
3683 · abort
3684 Abort current buffer/window. Prompt if it is changed.
3685
3686
3687 · abortbuf
3688 Like above, but just fail if it would have to prompt because it´s
3689 the last window on a modified buffer.
3690
3691
3692 · ask
3693 Prompt to save current file: user says yes return, user says no:
3694 run ´abort´. Use in a macro: "ask,query,exsave"
3695
3696
3697 · exsave
3698 Save file and exit
3699
3700
3701 · lose
3702 EMACS kill buffer. The buffer is deleted- any windows with it get a
3703 replacement scratch buffer.
3704
3705
3706 · querysave
3707 Prompt to save each modified buffer. Use in a macro:
3708 "querysave,query,killjoe"
3709
3710
3711 · killjoe
3712 Exit JOE immediately without checking for modified buffers
3713
3714
3715
3716 Files
3717 · cd
3718 Set directory prefix
3719
3720
3721 · save
3722 Save file
3723
3724
3725 · savenow
3726 Save immediately, unless file name is not known
3727
3728
3729 · insf
3730 Insert a file
3731
3732
3733
3734 Formatting
3735 · center
3736 Center line
3737
3738
3739 · fmtblk
3740 Format all paragraphs in a block
3741
3742
3743 · format
3744 Format current paragraph
3745
3746
3747 · lindent
3748 Indent to the left
3749
3750
3751 · rindent
3752 Indent to the right
3753
3754
3755
3756 Help
3757 · help
3758 Turn help on or off
3759
3760
3761 · hnext
3762 Switch to next help screen
3763
3764
3765 · hprev
3766 Switch to previous help screen
3767
3768
3769
3770 Inserting
3771 · ctrl
3772 Type next key
3773
3774
3775 · finish
3776 Complete word in text window
3777
3778
3779 · insc
3780 Insert a space
3781
3782
3783 · open
3784 Insert newline
3785
3786
3787 · quote
3788 Insert a control character
3789
3790
3791 · quote8
3792 Insert a meta character
3793
3794
3795 · rtn
3796 Return / Enter key
3797
3798
3799 · type
3800 Insert typed character
3801
3802
3803 · secure_type
3804 Insert typed character, but only allowed in prompt windows (not
3805 allowed in shell windows)
3806
3807
3808
3809 Macros
3810 · macros
3811 Insert keyboard macros into current file
3812
3813
3814 · play
3815 Execute a macro
3816
3817
3818 · query
3819 Suspend macro recording for user query
3820
3821
3822 · record
3823 Record a macro
3824
3825
3826 · stop
3827 Stop recording macro
3828
3829
3830
3831 Menu
3832 · backsmenu
3833 Undo in file completion menu
3834
3835
3836 · bofmenu
3837 Move to beginning of menu
3838
3839
3840 · bolmenu
3841 Move to beginning of line in a menu
3842
3843
3844 · dnarwmenu
3845 Move down one line in a menu
3846
3847
3848 · eolmenu
3849 Move cursor to end of line in a menu
3850
3851
3852 · eofmenu
3853 Move cursor to end of menu
3854
3855
3856 · ltarwmenu
3857 Move cursor left in a menu
3858
3859
3860 · rtarwmenu
3861 Move cursor right in menu
3862
3863
3864 · uparwmenu
3865 Move cursor up in menu
3866
3867
3868 · dnslidemenu
3869 Scroll menu down one line
3870
3871
3872 · upslidemenu
3873 Scroll menu up one line
3874
3875
3876 · pgupmenu
3877 Scroll menu up
3878
3879
3880 · pgdnmenu
3881 Scroll menu down
3882
3883
3884 · tabmenu
3885 Tab through menu
3886
3887
3888
3889 Misc
3890 · beep
3891 Beep
3892
3893
3894 · execmd
3895 Execute a JOE command
3896
3897
3898 · debug_joe
3899 Insert debug information into buffer
3900
3901
3902 · math
3903 Calculator
3904
3905
3906 · maths
3907 Secure Calculator (no way to run joe() macros)
3908
3909
3910 · mode
3911 Mode prompt
3912
3913
3914 · menu
3915 Menu prompt
3916
3917
3918 · msg
3919 Display a message
3920
3921
3922 · notmod
3923 Clear the modified flag
3924
3925
3926 · retype
3927 Refresh screen
3928
3929
3930 · shell
3931 Suspend process or execute a sub-shell
3932
3933
3934 · stat
3935 Display cursor position
3936
3937
3938 · tag
3939 Tags file search
3940
3941
3942 · tagjump
3943 Jump to next tags file search match (only if notagsmenu is set)
3944
3945
3946 · timer
3947 Execute a macro periodically
3948
3949
3950 · txt
3951 Insert text. If first character is `, then text is assumed to be a
3952 format string (that is, the string used to define the status line
3953 for the rmsg and lmsg options) and is formatted before the inser‐
3954 tion.
3955
3956
3957 · name
3958 Insert current file name
3959
3960
3961 · language
3962 Insert current language
3963
3964
3965 · charset
3966 Insert current character set
3967
3968
3969 · keymap
3970 Switch to another keymap
3971
3972
3973
3974 Prompts
3975 · complete
3976 Complete a file-name in a prompt
3977
3978
3979 · if
3980 Only run following cmds if expr is true (non-zero)
3981
3982
3983 · then
3984 Same as rtn but only works in prompt windows
3985
3986
3987 · elsif
3988 Try a new condition
3989
3990
3991 · else
3992 Toggle truth flag
3993
3994
3995 · endif
3996 Start running cmds again
3997
3998
3999
4000
4001 Here is an example ´if´ macro:
4002
4003 if,"char==65",then,"it´s an A",else,"it´s not an A",endif __^[ q__
4004
4005 When you hit __^[ q__, if the character under the cursor is an ´A´:
4006 "it´s a A" is inserted into the buffer, otherwise "it´s not an A" is
4007 inserted.
4008
4009 "if" creates a math prompt (like __Esc M__). "then" is like "rtn"- it
4010 hits the return key for this prompt.
4011
4012 Within the math prompt, the following variables are available:
4013
4014 · char
4015 ASCII value of character under cursor
4016
4017
4018 · width
4019 Width of screen
4020
4021
4022 · height
4023 Height of screen
4024
4025
4026 · byte
4027 byte number
4028
4029
4030 · col
4031 column number
4032
4033
4034 · line
4035 line number
4036
4037
4038 · lines
4039 no. lines in file
4040
4041
4042 · top
4043 line number of top line of window
4044
4045
4046
4047 Repeat
4048 · arg
4049 Prompt for repeat argument
4050
4051
4052 · uarg
4053 Universal argument
4054
4055
4056
4057 Scrolling
4058 · crawll
4059 Pan screen left
4060
4061
4062 · crawlr
4063 Pan screen right
4064
4065
4066 · dnslide
4067 Scroll screen down 1 line
4068
4069
4070 · pgdn
4071 Scroll screen down
4072
4073
4074 · pgup
4075 Scroll screen up
4076
4077
4078 · upslide
4079 Scroll up one line
4080
4081
4082
4083 Search and replace
4084 · ffirst
4085 Find text
4086
4087
4088 · fnext
4089 Repeat previous search
4090
4091
4092 · isrch
4093 Incremental search forward
4094
4095
4096 · qrepl
4097 Search and replace
4098
4099
4100 · rfirst
4101 Search backwards for text
4102
4103
4104 · rsrch
4105 Reverse incremental search
4106
4107
4108
4109 Windows
4110 · explode
4111 Display one window or display all windows
4112
4113
4114 · dupw
4115 Duplicate current window
4116
4117
4118 · groww
4119 Increase size of window
4120
4121
4122 · nextw
4123 Move cursor to next window
4124
4125
4126 · prevw
4127 Go to previous window
4128
4129
4130 · shrinkw
4131 Shrink window
4132
4133
4134 · splitw
4135 Split window into two
4136
4137
4138 · tw0
4139 Eliminate this window
4140
4141
4142 · tw1
4143 Show only one window
4144
4145
4146 · mwind
4147 Get error messages window on the screen and put cursor in it.
4148
4149
4150 · showlog
4151 Get startup log scratch buffer into window.
4152
4153
4154 · mfit
4155 Fit two windows on the screen: make current window 6 lines, and
4156 give rest of space to window above. The window above is either the
4157 existing previous window, a newly created one if there wasn´t one.
4158
4159
4160
4161 Undo
4162 · redo
4163 Re-execute the latest undone change
4164
4165
4166 · undo
4167 Undo last change
4168
4169
4170
4171 Mouse
4172 · tomouse
4173 Move the cursor to where the mouse was clicked/dragged
4174
4175
4176 · defmdown
4177 Default single-click handler, usually bound to MDOWN. Positions
4178 cursor to mouse and begins a region.
4179
4180
4181 · defmup
4182 Default single-click release handler, usually bound to MUP. Com‐
4183 pletes selection of a region.
4184
4185
4186 · defmdrag
4187 Default single-click drag handler, usually bound to MDRAG. Selects
4188 a region of text a character at a time.
4189
4190
4191 · defm2down
4192 Default double-click handler, usually bound to M2DOWN.
4193
4194
4195 · defm2up
4196 Default double-click release handler, usually bound to M2UP.
4197
4198
4199 · defm2drag
4200 Default double-click drag handler, usually bound to M2DRAG.
4201 Selects a region of text a word at a time.
4202
4203
4204 · defm3down
4205 Default triple-click handler, usually bound to M3DOWN.
4206
4207
4208 · defm3up
4209 Default triple-click release handler, usually bound to M3UP.
4210
4211
4212 · defm3drag
4213 Default triple-click drag handler, usually bound to M3DRAG.
4214 Selects a region of text a line at a time.
4215
4216
4217 · defmiddledown
4218 Default middle click handler, usually bound to MIDDLEDOWN. This
4219 inserts text.
4220
4221
4222 · defmiddleup
4223 Default middle click release handler, usually bound to MIDDLEUP.
4224
4225
4226 · xtmouse
4227 Handle xterm mouse events, usually bound to Esc [ M. It parses the
4228 rest of the sequence and generates fake "keys" that can be bound to
4229 macros in the joerc file. It uses a timer to detect double-click
4230 and triple-click. The keys are: MUP, MDOWN, MDRAG, M2UP, M2DOWN,
4231 M2DRAG, M3UP, M3DOWN, M3DRAG, MWUP and MWDOWN.
4232
4233
4234 · extmouse
4235 Handle extended xterm mouse events, usually bound to Esc [ <.
4236
4237
4238 · paste
4239 Insert base64 encoded text (for XTerm --enable-base64 option).
4240
4241
4242 · brpaste
4243 Disable autoindent, wordwrap and spaces. The idea is to bind this
4244 to Esc [ 2 0 0 ~ so that when the terminal emulator sends a mouse
4245 paste, the text is inserted as-is.
4246
4247
4248 · brpaste_done
4249 Restore autoindent, wordwrap and spaces modes to their original
4250 values before brpaste. The idea is to bind this to Esc [ 2 0 1 ~ so
4251 that these modes are restored after a mouse paste.
4252
4253
4254
4255
4256
4257
4258
4259 March 2016 JOE()