Skip to content

Formatting

jvim’s built-in formatter tidies your buffer without moving focus. Format the whole document in one keystroke, or limit the change to a selected region. Markdown lists get consistent spacing and numbering; code and config files are normalized with a Prettier-style pass where supported.

▶ Formatting: format document and selection
cast

Demo recording in progress — coming in the next release.

slug: formatting

Press Alt+F to run the formatter over the entire current buffer. The result appears in-place — jvim does not open a diff or a secondary pane. You can keep typing immediately after formatting; the cursor stays in the editor.

For Markdown files the formatter:

  • Corrects unordered-list indentation and bullet consistency.
  • Re-numbers ordered lists that have drifted out of sequence.
  • Normalises blank lines around headings and fenced code blocks.

For supported code and config files (JSON, YAML, JavaScript, TypeScript, CSS, HTML, and similar Prettier-backed formats) the formatter applies a Prettier-compatible style.

Format document with Alt+F

KeysActionNotes
Alt+FFormat current documentApplies to the entire buffer; cursor stays in place
Ctrl+SSaveReview the formatted result in the buffer before committing to disk

If you want to reformat only part of a document, select the region first with Shift+Arrow or Shift+Click, then press Alt+Shift+F. Only the selected lines are touched; the rest of the buffer is left exactly as-is.

KeysActionNotes
Alt+Shift+FFormat selectionRequires an active selection; no-op when nothing is selected

Selection-only formatting is useful when a file mixes hand-crafted prose with auto-generated tables or code blocks that should stay verbatim.

Formatting is applied to the in-memory buffer immediately, but the file is not saved automatically. Use Ctrl+S to write to disk once you are satisfied. If the result is not what you expected, Ctrl+Z undoes the format operation in a single step.

KeysActionNotes
Ctrl+ZUndoReverts the entire format operation at once