Skip to content

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 14 Nov 01:40
· 87 commits to main since this release

VimText 0.4.0: contenteditable editors

VimText gives Vim's modal editing to the text fields of ordinary web pages
(textarea, single-line text inputs and now contenteditable editors),
editing the page's own field in place: no native host, no replacement
editor. Chrome only.

Install: https://chromewebstore.google.com/detail/vimtext/egfolppakllammjdjnpbajpioigchbkp
Source, issues, design and the accepted limitations: https://github.com/Kyu-seok/VimText

0.4.0 closes M4. What is new since 0.3.0:

contenteditable editors

  • The rich-text boxes of sites such as Gmail, Slack and Notion are fields.
    Press Esc in one and it is under Vim, as a textarea is. Each editor is one
    field; its text is the editor's text without the formatting.
  • VimText's edits go through the editor: each one is offered to the editor
    first, as the editor's own typing would be, so the editor's model takes
    it. ProseMirror, Lexical, Slate and Quill are covered by tests against
    pinned builds of each, which check the editor's model, not only the page.
  • A mention chip, an inline image or another non-editable island counts as
    one character: motions step over it, x and dw delete it whole, and a yank
    stores its visible text (@alice, an image's alt text).
  • In a multi-line editor Enter in Normal is Vim's motion, so a chat box
    sends with Enter in Insert or Cmd/Ctrl+Enter. An editor that declares
    itself single-line (aria-multiline="false") follows the single-line
    input rules.
  • On a field taller than the window the Status Line stays in view.
  • Keys typed while an edit is still landing (the text after o or cw) are
    kept and land with it.

Every field

  • When a page refuses an edit (puts its text back), the page's text stays,
    VimText follows it, and the Status Line says the page refused the edit.
    This holds on textarea and input too.

Known limits on contenteditable editors

  • VimText edits the text and leaves the formatting to the editor. Yank and
    put carry plain text, never formatting; Cmd+V keeps the editor's own rich
    paste. Text written at the end of a formatted run takes that formatting,
    as typing there would.
  • u restores the text, not always its formatting: a character put back at
    the start of a bold run comes back plain, and an undone line join can
    leave a line in another kind of block.
  • A mention chip or inline image comes back from u only while VimText
    still holds it (the last 200 removed in that field). On Lexical, u after
    deleting one restores the text around it, without the chip or image.
  • VimText's edits are in the editor's own undo history too, so Cmd+Z in
    Insert can undo them; VimText catches up on the next key.
  • Notion makes each block its own editor, so each block is a field and j
    and k stop at its edge.
  • On Notion, o, O, a linewise p and u of J inside a block are refused:
    Notion takes no line break VimText writes. The Status Line says so;
    Enter in Insert makes a new block as usual.
  • Display-line motions and scrolls approximate on mixed fonts and sizes.
  • On an editor without a pinned test, VimText sees only the page's text,
    so an edit the editor's model did not take can go unnoticed.
  • An editor inside a closed shadow root is out of reach.
    The full list is under "Accepted limitations" in DESIGN.md.

Still true in 0.4.0

  • Chrome only. Firefox is untested and not submitted.
  • Canvas editors such as Google Docs are out of scope; password fields
    never.
  • A field starts in Insert mode and is the page's own until you press Esc
    or Ctrl+[ on it. In Insert mode IME, autocomplete and the site's own
    handlers work as before; only Esc, Ctrl+[, Ctrl-o, Ctrl-r, Ctrl-u and
    Ctrl-w are Vim's there.
  • No hlsearch highlighting (n and N work). Scroll commands (Ctrl-d/u/f/b,
    zz zt zb) approximate. Display-line motions approximate on unusual fonts.
    Visual block highlights only the primary range.
  • A mapping whose prefix is itself a bound key (nnoremap x dd while
    is l) never fires: the engine takes the full match at once rather
    than waiting like Vim's timeoutlen. Map from an unbound prefix such as .
  • The privacy policy is unchanged.

Bugs and questions: https://github.com/Kyu-seok/VimText/issues