conform.nvim
Lightweight yet powerful formatter plugin for Neovim
...It calculates minimal text differences instead of blindly replacing the entire buffer after formatting. This approach preserves folds, extmarks, cursor position, and other editor state more reliably. It can also repair responses from LSP formatters that otherwise replace complete buffers. Range formatting works even with many underlying formatters that do not natively provide that capability. The plugin supports format-on-save workflows, sequential or fallback formatters, embedded language formatting, extensive formatter customization, and a simple API modeled after Neovim's native LSP formatting interface.