joe   Joe's Own Editor

Joe's Own Editor - Commands

Home page
Release Notes
User Manual
Hacking
History

Project page
Download source

JOE commands grouped by function:

These commands can be entered at the ESC x prompt.

Background programs

bkndRun a shell in a window
killprocKill program in current window
runRun a UNIX command in a window
sysRun a UNIX command and return to editor when done (I/O does not go through editor, be we get the command's return status).

Blocks

blkcpyCopy marked block to cursor
blkdelDelete marked block
blkmoveMove marked block to cursor
blksaveSave marked block into a file
copyCopy block to kill-ring
dropSet markb. If it was already set, eliminate it.
droponSet markb. If it was already set, eliminate it. Turn on marking mode.
toggle_markingIf 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_markingIf 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.
selectSet markb. If it was already set, do nothing.
filtFilter block or file through a unix command
markbSet beginning of block mark
markkSet end of block mark
marklMark current line
nmarkEliminate markb and markk
picokillDelete line or block
popRestore markb and markk values from stack
pshPush markb and markk values onto a stack
swapSwitch cursor with markb
tomarkbMove cursor to markb
tomarkbkMove cursor to markb or markk
tomarkkMove cursor to markk
yankInsert top of kill ring
yankpopScroll through kill ring
yappAppend next kill to top of kill ring
upperConvert everything in block to uppercase
lowerConvert everything in block to lowercase

Buffers

bufedBuffer menu
editLoad file into window: asks to reload if buffer exists
switchLoad file into window: always uses buffer if it exists
scratchLoad a scratch buffer into current window
nbufLoad next buffer into current window
pbufLoad previous buffer into current window
reloadRe-read file into buffer (revert)
reloadallRe-read all unmodified buffers

Cursor Motion

bofMove cursor to beginning of file
bolMove cursor to beginning of line (always)
bopMove to beginning of a paragraph
bosMove to beginning of screen
bkwdcSearch backwards for a character
byteMove cursor to specific byte offset into the file.
colMove cursor to specific column number.
dnarwMove cursor down one line
eofMove cursor to end of file
eolMove cursor to end of line
eopMove cursor to end of paragraph
fwrdcSearch forward for matching character
gomarkMove cursor to a bookmark
homeMove cursor to beginning of line
lineMove cursor to specified line
ltarwMove cursor left
nedgeMove cursor to next edge
nextposMove cursor to next position in cursor position history
nextwordMove cursor to end of next word
pedgeMove cursor to previous edge
prevposMove cursor to previous position in cursor position history
prevwordMove cursor to beginning of previous word
rtarwMove cursor right
setmarkSet a bookmark
tomatchMove cursor to matching delimiter
tosMove cursor to top of screen
uparwMove cursor up

Deletion

backsBackspace
backwBackspace a word
delbolDelete to beginning of line
delchDelete character under cursor
deleolDelete to end of line
dellinDelete entire line
delwDelete word to right

Error parsing

nxterrGoto next parsed error
parserrParse errors in current file
prverrGo to previous parsed error
showerrShow current message

Exit

cancelLike abort, but doesn't return failure: useful in macros to escape out of a prompt.
abortAbort current buffer/window. Prompt if it is changed.
abortbufLike above, but just fail if it would have to prompt because it's the last window on a modified buffer.
askPrompt to save current file: user says yes return, user says no: run 'abort'. Use in a macro: "ask,query,exsave"
exsaveSave file and exit
loseemacs kill buffer. The buffer is deleted- any windows with it get a replacement scratch buffer.
querysavePrompt to save each modified buffer Use in a macro: "querysave,query,killjoe"
killjoeExit joe immediately without checking for modified buffers

Files

saveSave file
savenowSave immediately, unless file name is not known
insfInsert a file

Formatting

centerCenter line
fmtblkFormat all paragraphs in a block
formatFormat current paragraph
lindentIndent to the left
rindentIndent to the right

Help

helpTurn help on or off
hnextSwitch to next help screen
hprevSwitch to previous help screen

Inserting

ctrlType next key
finishComplete word in text window
inscInsert a space
openInsert newline
quoteInsert a control character
quote8Insert a meta character
rtnReturn key
typeInsert typed character

Macros

macrosInsert keyboard macros into current file
playExecute a macro
querySuspend macro recording for user query
recordRecord a macro
stopStop recording macro

Menu

backsmenuUndo in file completion menu
bofmenuMove to beginning of menu
bolmenuMove to beginning of line in a menu
dnarwmenuMove down one line in a menu
eolmenuMove cursor to end of line in a menu
eofmenuMove cursor to end of menu
ltarwmenuMove cursor left in a menu
rtarwmenuMove cursor right in menu
uparwmenuMove cursor up in menu
dnslidemenuScroll menu down one line
upslidemenuScroll menu up one line
pgupmenuScroll menu up
pgdnmenuScroll menu down

Misc

beepBeep
execmdExecute a joe command
mathCalculator
modeMode prompt
menuMenu prompt
msgDisplay a message
notmodClear the modified flag
retypeRefresh screen
shellSuspend process or execute a sub-shell
statDisplay cursor position
tagTags file search
txtInsert text
nameInsert current file name
languageInsert current language
charsetInsert current character set
keymapSwitch to another keymap

Prompts

completeComplete a file-name in a prompt
ifOnly run following cmds if expr is true (non-zero)
thenSame as rtn but only works in prompt windows
elsifTry a new condition
elseToggle truth flag
endifStart 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:

charASCII value of character under cursor
widthWidth of screen
heightHeight of screen
bytebyte number
colcolumn number
lineline number
linesno. lines in file
topline number of top line of window

Repeat

argPrompt for repeat argument
uargUniversal argument

Scrolling

crawllPan screen left
crawlrPan screen right
dnslideScroll screen down 1 line
pgdnScroll screen down
pgupScroll screen up
upslideScroll up one line

Search and replace

ffirstFind text
fnextRepeat previous search
isrchIncremental search forward
qreplSearch and replace
rfirstSearch backwards for text
rsrchReverse incremental search

Windows

explodeDisplay one window or display all windows
dupwDuplicate current window
growwIncrease size of window
nextwMove cursor to next window
prevwGo to previous window
shrinkwShrink window
splitwSplit window into two
tw0Eliminate this window
tw1Show only one window
mwindGet error messages window on the screen and put cursor in it.
mfitFit 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

redoRe-execute the latest undone change
undoUndo last change

Mouse

tomouseMove the cursor to where the mouse was clicked/dragged
defmdownDefault single-click handlers
defmdrag(click to move cursor, drag to select characters)
defm2downDefault double-click handlers
defm2drag(drag to select words)
defm3downDefault triple-click handlers
defm3drag(drag to select lines)
pasteInsert base64 encoded text (for XTerm --enable-base64 option).

Math

Math functions:

sin, cos, tan, exp, sqrt, cbrt, ln, log, asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, int, floor, ceil, abs, erf, erfc, j0, j1, y0, y1

Variables:

eSet to 'e'
piSet to 'pi'
topSet to line number of top window line
linesSet to number of lines in file
lineSet to current line number
colSet to current column number
byteSet to current byte number
sizeSet to buffer size
heightSet to window height
widthSet to window width
charSet to ASCII val of character under cursor
markvTrue if there is a valid block set (^KB ... ^KK)
rdonlyTrue if file is read-only
argCurrent repeat argument
argsetTrue if a repeat argument was given
no_windowsNo. buffer windows on the screen
ansResult of previous expression

Commands:

hexHex display mode
decDecimal display mode
insInsert 'ans' into buffer
sumSum of numbers in block
cntCount numbers in block
avgAverage value of numbers in block
devStandard deviation of numbers in block
evalEvaluate math expressions in block (or whole file if no block set).
joe..) Execute a JOE macro (argument in same format as joerc file macros). Return value of JOE macro is returned (for macro success, return true (non-zero)).

For example:

joe(sys,"[ 1 == 1 ]",rtn)

([ 1 == 1 ]) is a shell command. "[" is a synonym for the "test" UNIX command.

Returns true.

Remember: argument for JOE macro command "if" is a math expression. So for example, the macro:

if,"joe(sys,\"[ 1 == 1 ]\",rtn)",then,"TRUE",endif

Types TRUE into the buffer.

Operators:

^ * / % + - < <= > >= == != && || ? : = :

&&, || and ? : work as in C and sh as far as side effects: if the left side of && is false, the right side is not evaluated.

: is expression separator