From 7568de69f42882df528c9ec2447784a0042dd59d Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Tue, 12 Sep 2023 20:48:25 -0700 Subject: [PATCH] doc: add a features section to the README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 81575e35..9cf1343a 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Lightweight yet powerful formatter plugin for Neovim - [Requirements](#requirements) +- [Features](#features) - [Installation](#installation) - [Setup](#setup) - [Formatters](#formatters) @@ -24,6 +25,13 @@ Lightweight yet powerful formatter plugin for Neovim - Neovim 0.8+ +## Features + +- **Preserves extmarks and folds** - Most formatters replace the entire buffer, which clobbers extmarks and folds, and can cause the viewport and cursor to jump unexpectedly. Conform calculates minimal diffs and applies them using the built-in LSP format utilities. +- **Fixes bad-behaving LSP formatters** - Some LSP servers are lazy and simply replace the entire buffer, leading to the problems mentioned above. Conform hooks into the LSP handler and turns these responses into proper piecewise changes. +- **Enables range formatting for all formatters** - Since conform calculates minimal diffs, it can perform range formatting even if the underlying formatter doesn't support it. +- **Simple API** - Conform exposes a simple, imperative API modeled after `vim.lsp.buf.format()`. + ## Installation conform.nvim supports all the usual plugin managers