As usual, hit __Tab__ __Tab__ at the prompt for a completion list of the
menus which exist.
__^T__ is bound to the simple macro __menu,"root",rtn__- it brings up the
root of the options menu system.
## Xterm Mouse support
There are two levels of mouse support. The -mouse option enables the
first level, which will work with any stock Xterm. If -joexterm is also
set, mouse support is enhanced, but you need a recent version of XTerm,
and it needs to be ./configured with the --enable-paste64 option.
When -mouse is set, you can:
* Left-click in a text window to set the cursor position. Left-click in a
different window to move the cursor to a different window.
* Select text with the mouse. Left-click and drag to select some text- it
will be as if you had used __^K B__ and __^K K__ to mark it. Left-click (but don't
drag) to position the cursor somewhere else. Middle click to copy the
selected text to the cursor- it will be as if you had hit __^K C__. If you drag
past the edge of the text window, the window will auto-scroll to select more
text. Unfortunately, Xterm does not send any codes when the cursor is
outside of the Xterm frame itself, so this only works if the mouse is still
contained within the Xterm frame. I've sent a patch to the Xterm maintainer
to improve this, but he has not taken it yet.
* Resize windows with the mouse: click and hold on a status line
dividing two windows to move it.
* Select menu entries (such as any completion menu or the __^T__ options
menu): click on the menu item to position the cursor on it. Double-click on
a menu item to select it (same as hitting return with cursor on it).
* If your mouse has a wheel, turning the wheel will scroll the window with
the cursor.
Unfortunately, when -mouse is selected, cut and paste between X windows
does not work as it normally does in a shell window (left-click and drag to
select, middle click to paste). Instead, you have to hold the shift key
down to do this: shift-left-click and drag to select, and shift-middle click
to paste. Note that pasting text into JOE this way has problems: any \`
characters will get messed up because \` means quote the following control
character. Also if auto-indent is enabled, pasted text will not be indented
properly.
__Note:__ these problems with pasting have been resolved in recent versions
of JOE.
* JOE enables "bracketed paste" mode in Xterm so that pasted text is
bracketed with an escape sequence. This sequence causes JOE to disable
the autoindent, wordwrap and spaces modes for the paste, and restores them
when the paste is complete.
* Even if the terminal emulator does not have this bracketed paste mode,
JOE detects pasted text by timing: If text arrives all at once (all in the
same buffer), the text is assumed to be pasted text and autoindent and
wordwrap are temporarily disabled.
When -joexterm is set (and you have ./configured Xterm with
--enable-paste64):
* Cut & paste are properly integrated with X. Text selected with
left-click-drag is available for pasting into other X windows (even if the
selected text is larger than the text window). Text selected in other X
windows can be pasted into JOE with middle-click. There are no problems
pasting text containing ` or with auto-indent.
--enable-paste64 allows an application program to communicate Base-64
encoded selection data to and from the Xterm. The program has full control
over what is in the selection data and when it is received or sent.
## Color Xterm support
JOE can make use of monochrome Xterm, 8-color Xterm, 16-color Xterm,
88-color Xterm and 256-color Xterm. The number of colors which Xterm
supports is determined by which "configure" script options are set before
the Xterm source code is compiled. The termcap or terminfo entry must
support how your Xterm is configured. On my Slackware Linux distribution,
you have to set the TERM environment variable to one of these:
* xterm
* xterm-color
* xterm-16color
* xterm-88color
* xterm-256color
If the termcap/terminfo entry is missing, you can add the "-assume_256color"
option to the joerc file. Note that this was broken for terminfo in
versions of JOE below 3.4.
When it is working, the command: "joe -assume_256color -text_color bg_222"
should have a gray background.
## Hex edit mode
When this mode is selected (either put -hex on the command line, or look for
"Hex edit mode" after hitting __^T__), the buffer is displayed as a hex dump,
but all of the editing commands operate the same way. It is most useful to
select overtype mode in conjunction with hex dump (hit __^T T__). Then typing
will not insert.
- To enter the hex byte 0xF8 type __^Q x F 8__
- You can use __^K C__ to copy a block as usual. If overtype mode is selected,
the block will overwrite the destination data without changing the size of
the file. Otherwise it inserts.
- Hit __Esc X byte <Enter>__, to jump to a particular byte offset. Hex values
can be entered into this prompt like this: 0x2000.
- Search, incremental search, and search & replace all operate as usual.
## Environment variables
For JOE to operate correctly, a number of other environment settings must be
correct. The throughput (baud rate) of the connection between the computer
and your terminal must be set correctly for JOE to update the screen
smoothly and allow typeahead to defer the screen update. Use the __stty nnn__
command to set this. You want to set it as close as possible to
actual throughput of the connection. For example, if you are connected via
a 1200 baud modem, you want to use this value for __stty__. If you are
connected via 14.4k modem, but the terminal server you are connected to
connects to the computer a 9600 baud, you want to set your speed as 9600
baud. The special baud rate of 38400 or __extb__ is used to indicate that
you have a very-high speed connection, such as a memory mapped console or an
X-window terminal emulator. If you can't use __stty__ to set the actual
throughput (perhaps because of a modem communicating with the computer at a
different rate than it's communicating over the phone line), you can put a
numeric value in the __BAUD__ environment variable instead (use __setenv
BAUD 9600__ for csh or __BAUD=9600; export BAUD__ for sh).
The __TERM__ environment variable must be set to the type of terminal
you're using. If the size (number of lines/columns) of your terminal is
different from what is reported in the TERMCAP or TERMINFO entry, you can
set this with the __stty rows nn cols nn__ command, or by setting the
__LINES__ and __COLUMNS__ environment variables. The terminal size is
variable on modern systems and is determined by an ioctl, so these
parameters often have no effect.
JOE normally expects that flow control between the computer and your
terminal to use __^S__/__^Q__ handshaking (i.e., if the computer is sending
characters too fast for your terminal, your terminal sends __^S__ to stop the
output and __^Q__ to restart it). If the flow control uses out-of-band or
hardware handshaking or if your terminal is fast enough to always keep up
with the computer output and you wish to map __^S__/__^Q__ to edit commands, you can
set the environment variable __NOXON__ to have JOE attempt to turn off
__^S__/__^Q__ handshaking. If the connection between the computer and your terminal
uses no handshaking and your terminal is not fast enough to keep up with the
output of the computer, you can set the environment variable __DOPADDING__
to have __JOE__ slow down the output by interspersing PAD characters
between the terminal screen update sequences.
Here is a complete list of the environment variables:
* BAUD
Tell JOE the baud rate of the terminal (overrides value reported by stty).
* COLORTERM
If set to `truecolor` or `24bit`, [24-bit color support](https://gist.github.com/XVilka/8346728)
will be assumed and JOE will be able to load those sections from color
schemes.
* COLUMNS
Set number of columns in terminal emulator (in case
termcap entry is wrong). This is only useful on old system which don't have
the "get window size" ioctl.
* DOPADDING
Enable JOE to send padding NULs to the terminal
when set (for very old terminals).
* HOME
Used to get path to home directory for ~
expansion and also to find ~/.joerc file ~/.joe directory.
* HOSTNAME
Used to get hostname to put in EMACS compatible locks.
* JOETERM
Gives terminal type: JOE will use this instead of TERM if it's set.
* LANG
Sets locale (like en_US.utf-8). JOE uses
the first of these which is set: LC_ALL, LC_CTYPE, LANG.
* LC_ALL
Sets locale (like en_US.utf-8). JOE
uses the first of these which is set: LC_ALL, LC_CTYPE, LANG.
* LC_CTYPE
Sets locale (like en_US.utf-8). JOE
uses the first of these which is set: LC_ALL, LC_CTYPE, LANG.
* LINES
Set number of lines in terminal emulator (in case
termcap entry is wrong). This is only useful on old system which don't have
the "get window size" ioctl.
* NOXON
Disable __^S__ and __^Q__ flow control, possibly
allowing __^S__ and __^Q__ to be used as editor keys.
* SHELL
Path to shell (like /bin/sh). This is
used in several places: If you are on a system with no job control, this
shell is invoked when you hit __^K Z__. Also this is the shell which is run in shell
windows. If SHELL is not set (Cygwin) or if it's set to /bin/sh, JOE
invokes the first of these which exists: /bin/bash, /usr/bin/bash, /bin/sh.
* SIMPLE_BACKUP_SUFFIX
If this is set, it is
appended to the file name instead of ~ to create the backup file name.
* TAGS
If set to a path to a file, JOE tries to
use this as the "tags" file if there is no "tags" file in the current
directory.
* TEMP
If set, gives path to directory to open
swapfile instead of /tmp
* TERMCAP
Used by JOE's built-in termcap file
parser (not used for terminfo). A termcap entry can be placed directly in
this variable (which will be used if it matches TERM), or if it begins with
/, it gives a list of paths to termcap files to search.
* TERMPATH
Gives list of paths to termcap files to search when TERMCAP has a
termcap entry (otherwise it's ignored). The default list of paths to
termcap files (when TERMCAP and TERMPATH do not have it) is: "~/.termcap
/etc/joe/termcap /etc/termcap"
* TERM
Gives terminal type, like "vt100" or "xterm".
* USER
Used to get user name for EMACS compatible file locks.
## JOE commands grouped by function
These commands can be entered at the __Esc X__ prompt.
### Background programs
* bknd
Run a shell in a window
* vtbknd
Run a shell in a terminal emulator window
* killproc
Kill program in current window
* run
Run a UNIX command in a window
* sys
Run a UNIX command and return to editor when done (I/O does not go through editor, but we get the command's return status).
### Blocks
* blkcpy
Copy marked block to cursor
* blkdel
Delete marked block
* blkmove
Move marked block to cursor
* blksave
Save marked block into a file
* copy
Copy block to kill-ring
* drop
Set markb. If it was already set, eliminate Ait.
* dropon
Set markb. If it was already set, eliminate it. Turn on marking mode.
* toggle_marking
If we're in a block: clear markb and markk. If marking is off: set markb and turn on marking. If marking is on: set markk (swap if necessary with markb) and turn marking off.
* begin_marking
If we're on an edge of a block: set markb to other edge and turn on marking mode. Otherwise set markb to cursor and turn on marking mode.
* select
Set markb. If it was already set, do nothing.
* filt
Filter block or file through a UNIX command
* markb
Set beginning of block mark
* markk
Set end of block mark
* markl
Mark current line
* nmark
Eliminate markb and markk
* picokill
Delete line or block
* pop
Restore markb and markk values from stack
* psh
Push markb and markk values onto a stack
* swap
Switch cursor with markb
* tomarkb
Move cursor to markb
* tomarkbk
Move cursor to markb or markk
* tomarkk
Move cursor to markk
* yank
Insert top of kill ring
* yankpop
Scroll through kill ring
* yapp
Append next kill to top of kill ring
* upper
Convert everything in block to uppercase
* lower
Convert everything in block to lowercase
### Buffers
* bufed
Buffer menu
* edit
Load file into window: asks to reload if buffer exists
* switch
Load file into window: always uses buffer if it exists
* scratch
Push a scratch buffer into current window
* popabort
Abort and pop window from stack (do nothing if stack empty)
* nbuf
Load next buffer into current window
* pbuf
Load previous buffer into current window
* reload
Re-read file into buffer (revert)
* reloadall
Re-read all unmodified buffers
### Cursor Motion
* bof
Move cursor to beginning of file
* bol
Move cursor to beginning of line (always)
* bop
Move to beginning of a paragraph
* bos
Move to beginning of screen
* bkwdc
Search backwards for a character
* byte
Move cursor to specific byte offset into the file.
* col
Move cursor to specific column number.
* dnarw
Move cursor down one line
* eof
Move cursor to end of file
* eol
Move cursor to end of line
* eop
Move cursor to end of paragraph
* fwrdc
Search forward for matching character
* gomark
Move cursor to a bookmark
* home
Move cursor to beginning of line
* line
Move cursor to specified line
* ltarw
Move cursor left
* nedge
Move cursor to next edge
* nextpos
Move cursor to next position in cursor position history
* nextword
Move cursor to end of next word
* pedge
Move cursor to previous edge
* prevpos
Move cursor to previous position in cursor position history
* prevword
Move cursor to beginning of previous word
* rtarw
Move cursor right
* setmark
Set a bookmark
* tomatch
Move cursor to matching delimiter
* tos
Move cursor to top of screen
* uparw
Move cursor up
### Deletion
* backs
Backspace
* backw
Backspace a word
* delbol
Delete to beginning of line
* delch
Delete character under cursor
* deleol
Delete to end of line
* dellin
Delete entire line
* delw
Delete word to right
### Error parsing
* nxterr
Goto next parsed error
* parserr
Parse errors in current file
* gparse
Parse grep list in current file
* jump
Parse current line and jump to it
* prverr
Go to previous parsed error
* showerr
Show current message
* grep
Execute grep command, parse when done
* build
Execute build command, parse when done
* release
Release error/grep records
### Exit
* cancel
Like abort, but doesn't return failure: useful in macros to escape out of a prompt.
* abort
Abort current buffer/window. Prompt if it is changed.
* abortbuf
Like above, but just fail if it would have to prompt because it's the last window on a modified buffer.
* ask
Prompt to save current file: user says yes return, user says no: run 'abort'. Use in a macro: "ask,query,exsave"
* exsave
Save file and exit
* lose
EMACS kill buffer. The buffer is deleted- any windows with it get a replacement scratch buffer.
* querysave
Prompt to save each modified buffer. Use in a macro: "querysave,query,killjoe"
* killjoe
Exit JOE immediately without checking for modified buffers
### Files
* cd
Set directory prefix
* save
Save file
* savenow
Save immediately, unless file name is not known
* insf
Insert a file
### Formatting
* center
Center line
* fmtblk
Format all paragraphs in a block
* format
Format current paragraph
* lindent
Indent to the left
* rindent
Indent to the right
### Help
* help
Turn help on or off
* hnext
Switch to next help screen
* hprev
Switch to previous help screen
### Inserting
* ctrl
Type next key
* finish
Complete word in text window
* insc
Insert a space
* open
Insert newline
* quote
Insert a control character
* quote8
Insert a meta character
* rtn
__Return__ / __Enter__ key
* type
Insert typed character
* secure_type
Insert typed character, but only allowed in prompt windows (not allowed in shell windows)
### Macros
* macros
Insert keyboard macros into current file
* play
Execute a macro
* query
Suspend macro recording for user query
* record
Record a macro
* stop
Stop recording macro
### Menu
* backsmenu
Undo in file completion menu
* bofmenu
Move to beginning of menu
* bolmenu
Move to beginning of line in a menu
* dnarwmenu
Move down one line in a menu
* eolmenu
Move cursor to end of line in a menu
* eofmenu
Move cursor to end of menu
* ltarwmenu
Move cursor left in a menu
* rtarwmenu
Move cursor right in menu
* uparwmenu
Move cursor up in menu
* dnslidemenu
Scroll menu down one line
* upslidemenu
Scroll menu up one line
* pgupmenu
Scroll menu up
* pgdnmenu
Scroll menu down
* tabmenu
Tab through menu
### Misc
* beep
Beep
* execmd
Execute a JOE command
* debug_joe
Insert debug information into buffer
* math
Calculator
* maths
Secure Calculator (no way to run joe() macros)
* mode
Mode prompt
* menu
Menu prompt
* msg
Display a message
* notmod
Clear the modified flag
* retype
Refresh screen
* shell
Suspend process or execute a sub-shell
* stat
Display cursor position
* tag
Tags file search
* tagjump
Jump to next tags file search match (only if notagsmenu is set)
* timer
Execute a macro periodically
* txt
Insert text. If first character is \`, then text is assumed to be a format string (that is, the string used to define the status line for the rmsg and lmsg options) and is formatted before the insertion.
* name
Insert current file name
* language
Insert current language
* charset
Insert current character set
* keymap
Switch to another keymap
### Prompts
* complete
Complete a file-name in a prompt
* if
Only run following cmds if expr is true (non-zero)
* then
Same as rtn but only works in prompt windows
* elsif
Try a new condition
* else
Toggle truth flag
* endif
Start running cmds again
Here is an example 'if' macro:
if,"char==65",then,"it's an A",else,"it's not an A",endif __^[ q__
When you hit __^[ q__, if the character under the cursor is an 'A': "it's a A"
is inserted into the buffer, otherwise "it's not an A" is inserted.
"if" creates a math prompt (like __Esc M__). "then" is like "rtn"- it hits the
return key for this prompt.
Within the math prompt, the following variables are available:
* char
ASCII value of character under cursor
* width
Width of screen
* height
Height of screen
* byte
byte number
* col
column number
* line
line number
* lines
no. lines in file
* top
line number of top line of window
### Repeat
* arg
Prompt for repeat argument
* uarg
Universal argument
### Scrolling
* crawll
Pan screen left
* crawlr
Pan screen right
* dnslide
Scroll screen down 1 line
* pgdn
Scroll screen down
* pgup
Scroll screen up
* upslide
Scroll up one line
### Search and replace
* ffirst
Find text
* fnext
Repeat previous search
* isrch
Incremental search forward
* qrepl
Search and replace
* rfirst
Search backwards for text
* rsrch
Reverse incremental search
### Windows
* explode
Display one window or display all windows
* dupw
Duplicate current window
* groww
Increase size of window
* nextw
Move cursor to next window
* prevw
Go to previous window
* shrinkw
Shrink window
* splitw
Split window into two
* tw0
Eliminate this window
* tw1
Show only one window
* mwind
Get error messages window on the screen and put cursor in it.
* showlog
Get startup log scratch buffer into window.
* mfit
Fit two windows on the screen: make current window 6 lines, and give rest of space to window above. The window above is either the existing previous window, a newly created one if there wasn't one.
### Undo
* redo
Re-execute the latest undone change
* undo
Undo last change
### Mouse
* tomouse
Move the cursor to where the mouse was clicked/dragged
* defmdown
Default single-click handler, usually bound to MDOWN. Positions cursor to
mouse and begins a region.
* defmup
Default single-click release handler, usually bound to MUP. Completes
selection of a region.
* defmdrag
Default single-click drag handler, usually bound to MDRAG. Selects a region
of text a character at a time.
* defm2down
Default double-click handler, usually bound to M2DOWN.
* defm2up
Default double-click release handler, usually bound to M2UP.
* defm2drag
Default double-click drag handler, usually bound to M2DRAG. Selects a
region of text a word at a time.
* defm3down
Default triple-click handler, usually bound to M3DOWN.
* defm3up
Default triple-click release handler, usually bound to M3UP.
* defm3drag
Default triple-click drag handler, usually bound to M3DRAG. Selects a
region of text a line at a time.
* defmiddledown
Default middle click handler, usually bound to MIDDLEDOWN. This inserts
text.
* defmiddleup
Default middle button release handler, usually bound to MIDDLEUP.
* xtmouse
Handle xterm mouse events, usually bound to Esc \[ M. It parses the rest of
the sequence and generates fake "keys" that can be bound to macros in the
joerc file. It uses a timer to detect double-click and triple-click. The
keys are: MUP, MDOWN, MDRAG, M2UP, M2DOWN, M2DRAG, M3UP, M3DOWN, M3DRAG,
MWUP and MWDOWN.
* extmouse
Handle extended xterm mouse events, usually bound to Esc \[ \<.
* paste
Insert base64 encoded text (for XTerm --enable-base64 option).
* brpaste
Disable autoindent, wordwrap and spaces. The idea is to bind this to __Esc [ 2 0 0 ~__ so that when the terminal emulator sends a mouse paste, the text is inserted as-is.
* brpaste_done
Restore autoindent, wordwrap and spaces modes to their original values before brpaste. The idea is to bind this to __Esc [ 2 0 1 ~__ so that these modes are restored after a mouse paste.