-
Notifications
You must be signed in to change notification settings - Fork 9
Editing
Harry Pantazis edited this page Jun 9, 2017
·
3 revisions
The SchemeScript editor provides mainly useful editing commands. This section summarizes those commands (some of them are also available through the editor's context menu):
The editor provides the following commands:
| Command | Description | Default key sequences |
|---|---|---|
| Movement | ||
| Forward S-expression | Moves the cursor to the end of the next S-expression. | ALT-CTRL-F |
| Backward S-expression | Moves the cursor to the beginning of the previous S-expression. | ALT-CTRL-B |
| Up | S-expression | Moves the cursor to the beginning of the enclosing S-expression. |
| Down | S-expression | Moves the cursor inside the next list. |
| Jump to Definition | When the cursor is on a symbol corresponding to a globally defined variable inside the workspace, this command jumps to the definition (which can be in another file). | F12 |
| Find Symbol | Pops up a dialog box that asks for a symbol prefix and displays all matching symbols. (Only available in the Scheme Perspective.) | CTRL-F12 |
| Selection | ||
| Select Forward S-expression | Adds the next S-expression to the selection. | ALT-CTRL-SHIFT-F |
| Select Backward S-expression | Adds the previous S-expression to the selection. | ALT-CTRL-SHIFT-B |
| Select Up S-expression | Selects the enclosing S-expression. | CTRL-SHIFT-UP_ARROW |
| Restore the previous selection | Used in combination with the previous command. Restores the selection that was in effect before selecting the enclosing S-expression. | CTRL-SHIFT-DOWN_ARROW |
| Edition | ||
| Swap S-expressions | Swaps the two S-expressions that before and after the current cursor position. | ALT-CTRL-T |
| Format Selection | Formats the selection, essentially properly indenting the selected lines. | CTRL-I, CTRL-SHIFT-F, TAB |
| Compress Spaces | Replaces all whitespace characters surrounding the cursor with a single space. | ALT-CTRL-SPACEBAR |
| Mouse Copy | Copies the S-expression under the mouse position at the cursor position (removing the selection, if any). See the Mouse copy section. | ALT-CTRL-C |
| Extended Mouse Copy | As the Mouse Copy command, but also copies the punctuation characters immediately preceding the S-expression, if any (like an opening parenthesis, a quote, an unquote, etc.). See the Mouse copy section. | ALT-CTRL-X |
| Backward Slurp S-expression | Move the opening parenthesis of the surrounding S-expression one expression to the left. | ALT-SHIFT-B, S |
| Forward Slurp S-expression | Move the closing parenthesis of the surrounding S-expression one expression to the right. | ALT-SHIFT-F, S |
| Split S-expression | If the cursor is positioned inside a list, the list is split into two lists. | ALT-SHIFT-S |
| Join S-expressions | If the cursor is positioned between two lists, the two lists are merged to form a single list | ALT-SHIFT-J |
| Raise S-expression | Replace the surrounding S-expression by the S-expression on the right of the cursor. | ALT-CTRL-SHIFT-R |
| Splice S-expression | If the cursor is positioned inside a list, the list's parentheses are removed. | CTRL-( |
| Wrap S-expression | Adds parentheses around the S-expression on the right of the cursor. | CTRL-( |
| Kill next S-expression | Removes the S-expression on the right of the cursor. | CTRL-K |
| Kill previous S-expression | Removes the S-expression on the left of the cursor. | CTRL-SHIFT-K |
| Comments | ||
| Scheme file header comment | Insert, at the beginning of the file, a file header comment, with the author name, and a copyright notice (see the the comment section in the Scheme preferences). | ALT-C, H |
| Chapter comment | Insert a chapter-style comment (these comments appear in the Outline View). | ALT-C, C |
| Section comment | Insert a section-style comment (these comments appear in the Outline View). The section depth is determined by the number of * characters in front of the section name. | ALT-C, S |
| Toggle Comment | Comment out the lines in the selection (or the current line if there is no selection) or uncomment the lines if they are already commented out. | CTRL-/ |
| Evaluation | ||
| Start Interpreter | Starts the interpreter, if not already started. (Only available in the Scheme Perspective.) | F9 |
| Restart Interpreter | Restarts the interpreter unconditionally, first stopping any running interpreter. (Only available in the Scheme Perspective.) | CTRL-F9 |
| Eval Expression | Sends the previous S-expression to the Scheme interpreter, starting it if necessary. | CTRL-RETURN |
| Eval Toplevel Expression | Sends the enclosing top-level S-expression to the Scheme interpreter, starting it if necessary (useful when the cursor is inside a top-level definition and we want to send to definition to the interpreter). | CTRL-SHIFT-RETURN |
| Load File in Interpreter | Loads the current file in the Scheme interpreter, starting it if necessary. | CTRL-SHIFT-L |
| Fast Eval 0 | Sends a predefined string to the Scheme interpreter, starting it if necessary. | ALT-k 0 |
| Fast Eval 9 | Sends a predefined string to the Scheme interpreter, starting it if necessary. | ALT-k 9 |
| Kawa-specific | ||
| Expand typename | Replaces the symbol located just before the cursor position by the corresponding Java fully-qualified type name, surrounded by angle brackets (). | ALT-CTRL-SHIFT-T |
| Expand namespace | Replaces the symbol located just before the cursor position by a define-namespace form for the corresponding fully-qualified type name. | ALT-CTRL-SHIFT-N |
| Insert require clause | Adds a require clause for the module that defines the symbol at the cursor position. | CTRL-SHIFT-M |
Mouse copy is a command used to copy S-expressions using the mouse and a key sequence. To "mouse copy" an S-expression, you must:
- put the cursor where the S-expression should be copied (or select some text),
- move the mouse over the start or end of the desired S-expression (or simply over it in the case of a string, symbol, constant, etc),
- run either the Mouse Copy or Extended Mouse Copy command (see above).