Text and Code Editing on HP Prime.

PrimeEdit is a text/code editor: write and edit
plain text notes (.txt/.md), MicroPython (.py)
scripts, JSON files (.json), and real HP Prime
catalog programs (.hppl) directly on the
calculator. Line numbers, word wrap with
horizontal scroll, search & replace, undo/redo, a
dark theme with VS Code-style syntax highlighting
for .py/.hppl/.json, auto-completion, a browsable
command catalog, operator/symbol/character-table
panels, per-file-type customizable colors, and
text selection with copy/cut/paste make it
practical to write and fix real code on-device,
not just view it.


PrimeEdit - Quick Tutorial (EN)
===============================

Goal
- Edit .txt/.md notes, .py scripts, .json files,
  and .hppl catalog programs on HP Prime, with
  line numbers, search/replace, undo/redo, syntax
  highlighting, completion, and touch support.

Start and files
- On launch: a 2-second splash screen appears
  first (app name, version, date), then reopens
  the last file if save_config_files.txt exists,
  including a catalog .hppl program. The splash
  screen can only be turned off by editing
  settings.json directly.
- The app prevents auto-shutdown of the calculator
  (idle timeout raised) and disables screen
  dimming; both are restored on exit (Esc).
- Autosave is enabled by default; it saves every N
  minutes (default 5, adjustable from the options
  panel or a menu icon), but only if the buffer
  has unsaved changes: silent save if the file
  already has a name, otherwise it prompts to
  save.
- New (.txt/.json/.py/.hppl)/Open/Save/Save as
  icons. Save never asks for a file name, only
  Save As does. Saving under a name that already
  exists asks to confirm overwrite first.
- Save As lets you choose which installed app a
  .txt/.md/.py/.json file is saved under (default:
  PrimeEdit itself); a name ending in .hppl is
  instead written as a real catalog program
  through the Programs() mechanism. A dedicated
  "open program" icon lets you open and edit an
  existing catalog program directly.

Navigation and view
- Cursor: arrows, Home/End, page up/down. Tap
  anywhere in the text to place the cursor there;
  drag to scroll.
- Lines wrap at 80 columns, preferably after a
  space; beyond that, horizontal scrolling (touch
  drag, or automatic cursor follow while typing)
  reveals the rest of the line. Same behavior for
  every file type.
- The line-number gutter can be hidden from the
  options panel (see below) to gain width for
  wrapping.
- The caret blinks steadily so you can always find
  your position.

Typing text
- Characters are typed using the physical
  ALPHA/Shift keyboard layout, exactly like the
  calculator's own apps.
- ALPHA and Shift each cycle off -> once ->
  locked: tap once for a single character, tap
  twice quickly to lock it on, tap a third time to
  release it.

Search, replace, go to line, and undo/redo
- Plot opens the search prompt (or finds the next
  match if a search term is already set); View
  opens "go to line"; Menu/Symb open the menu and
  the color palette. None of these use a typing
  key, so every key on the keyboard stays free for
  editing.
- Cas undoes the last change, Num redoes it (32
  levels by default, adjustable from the options
  panel) - same actions as the "Undo"/"Redo" rows
  in the options panel.

File types: .txt, .md, .py, .json, and .hppl
- .txt/.md files display by default in plain black
  text on white (light theme); .py/.hppl/.json
  files switch to a dark theme by default (black
  background, white text) with full syntax
  highlighting. These colors are fully
  customizable, see "Color panel" below.
- Opened an .hppl file straight from the
  calculator's program catalog? It renders with
  the same highlighted view as a local .hppl file,
  and reloads automatically on the next startup.

Color panel
- A dedicated icon in the banner, right next to
  the hamburger (two small squares showing the
  current text/background colors), opens a panel
  grouping 10 settings, spread over several pages:
  background and text color for the buffer, the
  banner, the status bar, the panels, and the
  line-number gutter.
- Each row reopens the circular color wheel to
  pick a free (RGB) color. All 10 colors are set
  independently for each file type (.txt/.md share
  the same setting, .py/.hppl/.json each have
  their own) - switching files applies the
  matching type's colors automatically.
- Up/Down navigate the panel from the keyboard,
  Enter opens the color wheel on the selected row
  (or moves to the next/previous page on the
  "Next"/"Back" rows); tapping outside the panel
  closes it.

Syntax highlighting
- .py/.hppl/.json code is drawn with a dedicated
  fixed-size bitmap font so keywords, strings,
  comments, and numbers each get their own color,
  following the widely recognized VS Code "Dark+"
  scheme.

Auto-completion
- While typing an identifier in a .py or .hppl
  file, a suggestion popup opens automatically
  once you've typed 2 characters - keywords,
  built-in/library names, and identifiers already
  used elsewhere in the file all count.
- Up/Down move the selection inside the popup
  without moving your cursor in the text. Press
  Enter after using Up/Down to insert the
  highlighted suggestion; pressing Enter without
  having browsed the list just starts a new line
  as usual, so you never lose a line break by
  accident.
- Tapping a suggestion accepts it directly. A real
  function or method is inserted with its
  parentheses already in place, cursor landing in
  between, ready for arguments; a keyword or a
  plain identifier is inserted as-is.
- Auto-completion can be turned off from the
  options panel if you find it distracting.
- It never triggers inside a comment (# or //) or
  a Python """ block, even one spanning several
  lines.

Command catalog
- In a .py or .hppl file, a second icon in the top
  banner (showing "py"/"ppl", on the right) opens
  a full browsable catalog: HPPL commands grouped
  by category (graphics, strings, lists, control
  structures, and more), or MicroPython grouped by
  module, with classes and their methods nested
  one level down.
- Browse with Next/Back, tap an entry to insert it
  at the cursor. This is meant for discovering a
  command you don't remember the exact name of, as
  an alternative to typing a prefix into the
  completion popup.

Operators, symbols, and character table panels
- Shift+6 opens a grid of comparison/logical
  operators (<= >= != AND OR NOT...) matched to
  the open file's language; Shift+9 opens a grid
  of symbols and Greek letters (-> infinity ° ' "
  & Å alpha beta gamma...). Both are available in
  every file type, tap an entry to insert it at
  the cursor.
- Shift+Vars (or the "Character table" row in the
  options panel) opens a browser of common Unicode
  blocks (Latin, Greek, Cyrillic, symbols...) with
  quick access to accented letters pinned at the
  top, for inserting a character missing from the
  physical keyboard.

Options panel
- Tap the hamburger icon (three bars, top-left of
  the banner) or the Apps key to open a compact
  panel of settings and actions:
  - Line numbers: show or hide the gutter.
  - Auto-completion: turn the suggestion popup on
    or off.
  - Save interval: how often autosave fires, in
    minutes.
  - Undo/redo levels: how many levels are kept (32
    by default).
  - Selection: arm or disarm a text selection
    anchored at the current cursor position.
  - Copy / Cut / Paste, acting on the current
    selection and an in-memory clipboard that
    survives switching to a different file.
  - Undo / Redo: same actions as the Cas/Num keys.
  - Character table: opens the Unicode character
    panel described above.
- Tap outside the panel to close it.

Text selection
- Once armed from the options panel, any cursor
  movement - arrows, Home/End, page jumps, or a
  tap elsewhere in the text - extends the
  selection, shown as a highlighted band. No extra
  key combination is needed.
- Copy leaves the selection in place after
  copying; Paste replaces an active selection with
  the clipboard content, the same way most editors
  behave.

Shortcuts (HP Prime keys)
- Menu: open menu. Symb: color palette. Plot:
  search / find next. View: go to line. Cas:
  undo. Num: redo. Shift+6: operators. Shift+9:
  symbols. Shift+Vars: character table. Apps:
  options panel. Esc: close an open popup/panel,
  or exit the app if nothing is open (offers to
  save first if there are unsaved changes).
