forge Documentation

editor-guide

Editor Guide

Complete reference for the FORGE integrated editor.

Overview

The FORGE IDE includes a full-screen editor for writing and editing BASIC programs. All editor commands use the CONTROL key in combination with another key.

Keyboard Shortcuts Reference

ShortcutCommandDescription
Ctrl-AMove to beginningMoves cursor to the beginning of the current line
Ctrl-EMove to endMoves cursor to the end of the current line
Ctrl-UPage upMoves cursor 19 lines up
Ctrl-IPage downMoves cursor 19 lines down
Ctrl-ZUndoReverts all editing of the current line
Ctrl-CSet MarkSets the current line as source for copy operation
Ctrl-VPasteCopies line from marked position to current cursor position
Ctrl-QQuitReturns to DOS, abandoning changes
Ctrl-SSaveSaves the current file to disk
Ctrl-LLoadLoads a file from disk
Ctrl-NNew fileStarts editing a new file
Ctrl-RRunParses and runs the current program
Ctrl-WCompileCompiles the program to a binary file
Ctrl-GGo to lineMoves cursor to a specific line number

Navigation Commands

Line Navigation

  • CONTROL-A and CONTROL-E: Moves the cursor to the beginning or the end of the line respectively.

Page Navigation

  • CONTROL-U and CONTROL-I: Moves the cursor 19 lines up or down respectively. This provides quick page-by-page navigation through your program.

Go to Line

  • CONTROL-G: Moves the cursor to a specific line. The editor will prompt you for the line number.

Editing Commands

Undo

  • CONTROL-Z: Reverts all editing of the current line. Note that changing the line clears the undo buffer, so you can't undo more than one line.

Copy and Paste

  • CONTROL-C: Sets the current line as the source for a copy operation.
  • CONTROL-V: Copies one line from the source marked with CONTROL-C to the current cursor position. After the copy, the source line is advanced, so by pressing CONTROL-V multiple times you can copy multiple consecutive lines.

Example workflow:

  1. Move to the line you want to copy
  2. Press CONTROL-C to mark it
  3. Move to where you want to paste
  4. Press CONTROL-V to paste (repeat to paste multiple lines)

File Operations

New File

  • CONTROL-N: Starts editing a new file. If the current file has unsaved changes, you'll be prompted to save.

Load File

  • CONTROL-L: Loads a file from disk. You'll be prompted for the filename.

Save File

  • CONTROL-S: Saves the file being edited. You'll be prompted for the filename if it's a new file.

Tips:

  • Press ESC to cancel any file operation prompt
  • Use BACKSPACE to edit the proposed filename
  • Save often to avoid losing work

Quit

  • CONTROL-Q: Returns to DOS, abandoning any changes in the current file. You'll be prompted to confirm if there are unsaved changes.

Program Execution

Run Program

  • CONTROL-R: Parses the current program and runs it. If there are syntax errors, the cursor will move to the error location.

Compile Program

  • CONTROL-W: Compiles the current program and saves it to a binary file. You'll be prompted for the output filename.

See Compiling for more details on compilation.

Cursor Movement

In addition to the CONTROL key combinations, you can use:

  • Cursor keys: CONTROL and -, =, + or * to move the cursor
  • BACKSPACE: Delete character before cursor
  • DELETE: Delete character at cursor (or CONTROL + BACKSPACE)
  • RETURN: Move to next line
  • DELETE at end of line: Join two lines together

Workflow Tips

Efficient Editing

  1. Use keyboard shortcuts - They're much faster than menu navigation
  2. Learn the abbreviations - Many FORGE statements can be abbreviated
  3. Use copy/paste - For repetitive code patterns
  4. Save frequently - Use CONTROL-S often

Code Organization

  1. Use comments - Start lines with ' or . for comments
  2. Indent logically - While not required, indentation improves readability
  3. Group related code - Keep related statements together

Debugging

  1. Use CONTROL-R - Run frequently to catch errors early
  2. Check error location - Cursor automatically moves to syntax errors
  3. Use CONTROL-G - Jump to specific line numbers when debugging

Editor Features

Line Numbers

The editor displays the current line number on the right side of the first line of the screen.

Empty Lines

Lines that show an arrow pointing to the top-left are empty lines beyond the last line of the current file.

File Name Display

The name of the currently edited file is shown on the first line of the screen.

Limitations

  • Undo is limited - Only the current line can be undone
  • No multi-line selection - Copy/paste works one line at a time
  • No search/replace - Manual editing required

Next Steps