Series to explore Neovim plugins and configuration recipes.
This article is part of the Neovim Plugins and Configuration Recipes series.
The Neovim configuration files are available in this repository.
Getting Started
In this article, we continue to explore Neovim plugins and configuration recipes to improve our development workflow.
Plugins
conform.nvim
conform.nvim
is a lightweight yet powerful formatter plugin for Neovim. It is a good alternative to null-ls.nvim
in terms of formatting.
It provides the following 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 turn these responses into proper piecewise changes.
- Enables range formatting for all formatters — Since conform calculates minimal diffs, it…