2.3 Command-line editing

Gforth maintains a history file that records every line that you type to
the text interpreter. This file is preserved between sessions, and is
used to provide a command-line recall facility; if you type Ctrl-P
repeatedly you can recall successively older commands from this (or
previous) session(s). The full list of command-line editing facilities is:

Ctrl-p (“previous”) (or up-arrow) to recall successively older
commands from the history buffer.

Ctrl-n (“next”) (or down-arrow) to recall successively newer commands
from the history buffer.

Ctrl-f (or right-arrow) to move the cursor right, non-destructively.

Ctrl-b (or left-arrow) to move the cursor left, non-destructively.

Ctrl-h (backspace) to delete the character to the left of the cursor,
closing up the line.

Ctrl-k to delete (“kill”) from the cursor to the end of the line.

Ctrl-a to move the cursor to the start of the line.

Ctrl-e to move the cursor to the end of the line.

<RET> (Ctrl-m) or <LFD> (Ctrl-j) to submit the current
line.

<TAB> to step through all possible full-word completions of the word
currently being typed.

Ctrl-d on an empty line line to terminate Gforth (gracefully,
using bye).

Ctrl-x (or Ctrl-d on a non-empty line) to delete the
character under the cursor.

When editing, displayable characters are inserted to the left of the
cursor position; the line is always in “insert” (as opposed to
“overstrike”) mode.

On Unix systems, the history file is ~/.gforth-history by
default1. You
can find out the name and location of your history file using: