krz/orgstar

A native macOS editor for org-mode files. editor org-mode swift

docs/plans/2026-10-05-doom-keys.md

778058aafc7ddacee4a613b1da87c60aa0c8e113
orgstar/docs/plans/2026-10-05-doom-keys.md rendered · source · history · blame · raw

23 lines · 2328 bytes

Doom Keymap Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: A Doom preset: evil's modal editing with Doom's settings, Doom's leader and localleader keys for org, and evil-org's keys.

Architecture: OrgCore/Keymap/Vim.swift is the modal engine, pure so it can be checked against evil: normal, insert, visual and visual-line states; counts and registers ("a–"z, append with capitals, "_, "0, the unnamed register on the clipboard); operators d c y > < g~ gu gU with motions (h j k l w W b B e E ge gE 0 ^ $ g_ gg G f F t T ; , % { } n N * #, C-d, C-u) and text objects (iw aw iW aW quotes, brackets, ip ap); x X D C Y(=y$) p P J r ~ i a I A o O v V u C-r .; evil-snipe's s/S (line scope, smart case); insert-state C-w and C-u; Doom's settings (evil-start-of-line nil, evil-shift-width = Org's tab width, Y to the end of the line). o/O/cc indent as indent-according-to-mode does in Org. The Doom preset is generated: the Emacs preset's C-c/C-x/meta/shift org keys copied into each state (with evil-org's M-h/j/k/l and insert-state C-t/C-d), then Doom's SPC leader and SPC m localleader for org, TAB, RET (+org/dwim-at-point as OrgDwim), z a/c/o, g h/j/k, ]h/[h. The editor offers keys to the keymap for the current state, then to the engine, applies its edits as undo steps, draws a block cursor outside insert state, and reads /, ? and : (:w, :q, :wq, :N, :s, :%s) in the echo area.

Tech Stack: Swift 6.2 tools, Swift Testing; evil and evil-snipe from your Doom install as the oracle in batch Emacs.

Spec: docs/design.md, "Keymaps" (Doom).

Global Constraints

  • Oracle: 125 key sequences run by evil (+ evil-snipe) in batch Emacs on an Org buffer; text, point and state compared.
  • Not yet: macros (q, @), marks, jumps (C-o/C-i), gv, block visual (C-v), evil-surround, evil-commentary, evil-org text objects (ae, iR…), numbered delete registers.

  • Vim; oracle.
  • Doom preset; OrgDwim.
  • Editor routing, block cursor, prompts, ex commands; editor tests.
  • Commit "Doom keymap".