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
- On OS X the Command key is the Apple key just to the left of the Spacebar.
- On Linux and Windows the Command key is the Control key on the far left side of the keyboard
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 N | new file |
COMMAND O | open file |
COMMAND S | save |
COMMAND SHIFT S | save as |
COMMAND OPTION S | save version |
COMMAND W | close window |
Edit Commands
COMMAND Z | undo |
COMMAND SHIFT Z | redo |
COMMAND X | cut |
COMMAND C | copy |
COMMAND V | paste |
COMMAND A | select all |
COMMAND F | find and replace |
COMMAND L | Lookup symbol documentation |
TAB | indent code |
View Commands
COMMAND = | font larger |
COMMAND - | font smaller |
Eval Commands
COMMAND RET | execute code |
COMMAND . | stop execution |
Emacs Keyboard Commands
If 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.
- On OS X the Emacs Meta key is the Option key just right of the control key.
- On Linux and Windows the Meta key is the Alt key just to the left of the Spacebar.
Cursor Motion
C-f | forward character |
C-b | backward character |
M-f | forward word |
M-b | backward word |
C-M-f | forward expression |
C-M-b | backward expression |
Line Motion
C-a | beginning of line |
C-e | end of line |
C-n | next line |
C-p | previous line |
Scrolling
C-v | forward screen |
M-v | backward screen |
M-> | beginning of file |
M-< | end of file |
Editing
C-d | delete character |
M-d | delete word |
C-M-k | kill expression |
C-k | kill to end of line |
C-y | yank kill(s) back |
C-o | open new line |
M-l | lower case word |
M-u | upper case word |
M-c | capitalize word |
C-s | find and replace |
TAB | indent line |
M-. | Lookup symbol documentation |
File Commands
C-x C-f | open file |
C-x C-s | save file |
C-x C-w | save file to new name |
C-x C-c | close window |
Eval
C-x C-e | execute code |
C-. | stop execution |