feat: add format subcommand for CLI formatting #127

Merged
barrettruth merged 1 commit from feat/format-subcommand into main 2026-03-25 14:56:14 +00:00
barrettruth commented 2026-03-25 14:49:36 +00:00

Problem

The formatter is only accessible via LSP textDocument/formatting, requiring a running editor. There's no way to format vimdoc files from the CLI for CI pipelines, pre-commit hooks, or batch operations.

Solution

Add a format subcommand mirroring the existing check pattern. vimdoc-language-server format doc/ formats files in-place; --check exits 1 if any file would change (for CI). Directories are globbed for *.txt files. Global --line-width, --reflow, and --normalize-spacing flags apply. Both format and check are now documented in the README under a new CLI section.

## Problem The formatter is only accessible via LSP `textDocument/formatting`, requiring a running editor. There's no way to format vimdoc files from the CLI for CI pipelines, pre-commit hooks, or batch operations. ## Solution Add a `format` subcommand mirroring the existing `check` pattern. `vimdoc-language-server format doc/` formats files in-place; `--check` exits 1 if any file would change (for CI). Directories are globbed for `*.txt` files. Global `--line-width`, `--reflow`, and `--normalize-spacing` flags apply. Both `format` and `check` are now documented in the README under a new CLI section.
vercel[bot] commented 2026-03-25 14:49:41 +00:00

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vimdoc-language-server Ready Ready Preview, Comment Mar 25, 2026 2:49pm
[vc]: #QH6ODETZO2uMLPSs18jw+PFaxf32HKnWPIqjvlW2/xM=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJ2aW1kb2MtbGFuZ3VhZ2Utc2VydmVyIiwicHJvamVjdElkIjoicHJqX1ZFR2Q3U2tjWTdENEJEdVNDUVh2WTE4VXV1WlEiLCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vYmFycmV0dHJ1dGgvdmltZG9jLWxhbmd1YWdlLXNlcnZlci9HVlZzTXc3OFpCS1FCUnVnTGh6R3pBbm9iY0h4IiwicHJldmlld1VybCI6InZpbWRvYy1sYW5ndWFnZS1zZXJ2ZXItZ2l0LWZlYXQtZm9ybWF0LXN1YmNvbW1hbmQtYmFycmV0dHJ1dGgudmVyY2VsLmFwcCIsIm5leHRDb21taXRTdGF0dXMiOiJERVBMT1lFRCIsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiJ2aW1kb2MtbGFuZ3VhZ2Utc2VydmVyLWdpdC1mZWF0LWZvcm1hdC1zdWJjb21tYW5kLWJhcnJldHRydXRoLnZlcmNlbC5hcHAifSwicm9vdERpcmVjdG9yeSI6InNpdGUifV19 The latest updates on your projects. Learn more about [Vercel for GitHub](https://vercel.link/github-learn-more). | Project | Deployment | Actions | Updated (UTC) | | :--- | :----- | :------ | :------ | | [vimdoc-language-server](https://vercel.com/barrettruth/vimdoc-language-server) | ![Ready](https://vercel.com/static/status/ready.svg) [Ready](https://vercel.com/barrettruth/vimdoc-language-server/GVVsMw78ZBKQBRugLhzGzAnobcHx) | [Preview](https://vimdoc-language-server-git-feat-format-subcommand-barrettruth.vercel.app), [Comment](https://vercel.live/open-feedback/vimdoc-language-server-git-feat-format-subcommand-barrettruth.vercel.app?via=pr-comment-feedback-link) | Mar 25, 2026 2:49pm |
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/vimdoc-language-server!127
No description provided.