The Code Editor

Grace provides a full-featured code editor supporting both Lisp (Scheme) and Sal languages; each language, in turn, determines how code is colorized, indented, parsed and evaluated. The editor chooses between code syntaxes based, in part, on the extension of the file you open:

Syntax File Extensions
Sal .sal .sal2 .sal1
Scheme .lisp .lsp .cl .scm .cm .clm .ins
Text .text .txt .*

The code editor supports the standard keyboard commands found in most text editors as well as many Emacs keyboard commands. On OS X both commands sets are available simultaneously but on Linux and Windows the standard keyboard commands are disabled if Emacs Mode is turned on because Emacs uses the same key (Control) as its command key.

Standard Keyboard Commands

Cursor Motion

Include SHIFT with cursor commands to select text.
move character left
move character right
OPTION ←move word left
OPTION →move word right
COMMAND ←move to start of line
COMMAND →move to end of line
COMMAND ↑move line up
COMMAND ↓move line down
COMMAND ↑move to start of buffer
COMMAND ↓move to end of buffer

File Commands

COMMAND Nnew file
COMMAND Oopen file
COMMAND Ssave
COMMAND SHIFT Ssave as
COMMAND OPTION Ssave version
COMMAND Wclose window

Edit Commands

COMMAND Zundo
COMMAND SHIFT Zredo
COMMAND Xcut
COMMAND Ccopy
COMMAND Vpaste
COMMAND Aselect all
COMMAND Ffind and replace
COMMAND LLookup symbol documentation
TABindent code

View Commands

COMMAND =font larger
COMMAND -font smaller

Eval Commands

COMMAND RETexecute code
COMMAND .stop execution

Emacs Keyboard Commands

If Edit>Emacs Keys is turned on then the editor provides the Emacs commands listed below. Emacs commands are keystroke combinations involving the CONTROL and/or META keys combined with a key press. In the documentation that follows pressing CONTROL or META is shortened to C- and M- respectively. For example, C-f means to hold down the Control key and type f and C-M-f means to hold down both the Control and Meta keys while typing f.

Cursor Motion

C-fforward character
C-bbackward character
M-fforward word
M-bbackward word
C-M-fforward expression
C-M-bbackward expression

Line Motion

C-abeginning of line
C-eend of line
C-nnext line
C-pprevious line

Scrolling

C-vforward screen
M-vbackward screen
M->beginning of file
M-<end of file

Editing

C-ddelete character
M-ddelete word
C-M-kkill expression
C-kkill to end of line
C-yyank kill(s) back
C-oopen new line
M-llower case word
M-uupper case word
M-ccapitalize word
C-sfind and replace
TABindent line
M-.Lookup symbol documentation

File Commands

C-x C-fopen file
C-x C-ssave file
C-x C-wsave file to new name
C-x C-cclose window

Eval

C-x C-eexecute code
C-.stop execution