Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>NewlinerNew to Visual Studio Code? Get it now.
Newliner

Newliner

Sasha Petrenko

|
15 installs
| (0) | Free
Keep prose sentences on their own lines in Markdown, Quarto, AsciiDoc, Org-mode, reStructuredText, plain text, TeX, and Typst while preserving document structure.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

newliner-header

Newliner is a VS Code extension that keeps Markdown, Quarto, AsciiDoc, Org-mode, reStructuredText, plain-text, TeX, and Typst prose in a sentence-per-line style. While you write, it formats only the active paragraph so that it can stay enabled without scanning the whole file on every keystroke.

This extension also has customizable behavior! By default, it runs on .md, .qmd, .adoc, .org, .rst, .txt, .tex, and .typ files, but you can add any other file extensions for this to run on. You can even have it just run on all files, and you can toggle the extension on and off whenever you need. Most importantly, you can have it run in different modes:

  1. After a short debounce during typing
  2. Only when saving
  3. Triggered manually when needed

Table of Contents

  • Table of Contents
  • Features
  • Commands
  • Settings
  • Development
  • Credits
    • Assets
    • Author
  • Notes-To-Self

Features

This extension has the following feature set:

  • Splits prose so each detected sentence starts on its own line.
  • Combines accidental mid-sentence line breaks before splitting sentences again.
  • Skips fenced code blocks, headings, tables, HTML blocks, link reference definitions, and other structural Markdown.
  • Preserves Markdown and plain-text inline code, links, autolinks, URLs, and email addresses as indivisible spans.
  • Understands Quarto YAML front matter, executable code cells, fenced divs, shortcodes, attributes, citations, and math while formatting surrounding prose.
  • Understands AsciiDoc headings, attributes, macros, lists, delimited blocks, comments, tables, cross-references, and inline literals.
  • Understands Org-mode outlines, keywords, planning lines, drawers, blocks, tables, links, timestamps, macros, and inline literals.
  • Understands reStructuredText and Sphinx structure, including directives, targets, field lists, section adornments, literal blocks, doctests, roles, and tables.
  • Formats prose in RST paragraphs, lists, field descriptions, and admonition bodies without rewriting syntax-oriented blocks.
  • Formats ordinary plain-text paragraphs while preserving fenced or indented code, terminal prompts, command lines, configuration fragments, and ASCII tables.
  • Understands TeX commands, comments, math delimiters, environments, and \\item lists, keeping code- and math-oriented regions unchanged.
  • Understands Typst commands, comments, raw blocks, math, headings, labels, references, and markup lists while formatting surrounding prose.
  • Formats prose inside list items and blockquotes while preserving their Markdown prefixes.
  • Keeps cursors and selections anchored to the same prose while formatting inserts or removes line breaks.
  • Shows enabled state and the active formatting mode in a clickable VS Code status-bar indicator.
  • Provides commands and settings toggles for live formatting and save-time formatting.

Commands

Here are the main commands for controlling Newliner's behavior:

  • Newliner: Toggle Enabled turns the extension on or off.
  • Newliner: Format Sentences formats the active document when its file type is eligible (one-shot).
  • Newliner: Format Selection formats prose within the selected full-line region while preserving surrounding syntax context. Multiple selections are supported.
  • Newliner: Toggle File Extension List controls whether Newliner only runs on configured file extensions (default on).
  • Newliner: Toggle Format While Typing controls live paragraph formatting.
  • Newliner: Toggle Format On Save controls save-time document formatting.

The status bar item appears in eligible files and toggles the extension when clicked. Its icon and label show the current mode:

  • $(sync) Newliner: Live means formatting runs after the configured typing debounce.
  • $(save) Newliner: Save means formatting runs when the document is saved.
  • The sync and save icons together mean both automatic modes are active.
  • $(edit) Newliner: Manual means only the formatting commands run.
  • $(circle-slash) Newliner: Off means Newliner is disabled.

Hover over the indicator to see the configured debounce and a plain-language mode description.

Settings

You can configure all of the behavior of this extension with the following settings.json entries:

  • newliner.enabled: enable or disable the extension.
  • newliner.useFileExtensionList: only run on file extensions in newliner.fileExtensions.
  • newliner.fileExtensions: file extensions Newliner can run on when newliner.useFileExtensionList is enabled. The default is [".md", ".qmd", ".adoc", ".org", ".rst", ".txt", ".tex", ".typ"].
  • newliner.formatOnType: format the current paragraph while typing in eligible files.
  • newliner.formatOnSave: format eligible files when saved.
  • newliner.debounceMs: live-format debounce delay in milliseconds.
  • newliner.abbreviations: complete case-insensitive abbreviation list. Add domain-specific entries or remove built-ins; terminal periods are optional.
  • newliner.respectCodeFences: leave fenced code blocks untouched.
  • newliner.formatLists: format prose inside supported list items.
  • newliner.formatBlockquotes: format prose inside blockquotes.

For example, this replaces the default abbreviation list with project-specific terminology:

"newliner.abbreviations": ["Dr", "e.g.", "SDK", "Acme"]

Because this setting is the complete effective list, omitting a built-in entry removes its special handling.

Development

Install dependencies, compile the TypeScript sources, and run the tests via:

npm install
npm run compile
npm test

Run the formatter performance and scaling checks separately via:

npm run test:performance

The benchmark reports median formatting time, approximate heap allocation, live-range and selected-range latency, cursor-mapping latency, and dense inline-syntax performance for every supported document mode. It fails when the final input doubling exceeds the configured scaling budget.

Open this folder in VS Code and press F5 to compile and launch an Extension Development Host.

Credits

Assets

This project uses the following external assets:

  • Flaticon arrow_14096294

Author

  • Sasha Petrenko petrenkos@mst.edu - @AP6YC

Notes-To-Self

Because I keep forgetting how to release a patch of a VSCode extension:

vsce publish patch

To run detailed tests on the package:

npm test
npm run compile
npm pack --dry-run
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft