A Neovim plugin that automatically formats files on save using LSP or shell utilities like prettierd and shfmt.
format-on-save.nvim is a Neovim plugin that automatically formats code when files are saved, using either Language Server Protocol (LSP) formatters or shell utilities like prettierd and shfmt. It solves the problem of maintaining consistent code style without manual intervention, especially after the deprecation of tools like null-ls.
Neovim users who want automated, reliable code formatting integrated into their editor workflow, particularly those transitioning from null-ls or seeking a simple format-on-save solution.
Developers choose this plugin for its straightforward synchronous approach, support for both LSP and shell formatters, and features like cursor restoration, avoiding the complexity and edge cases found in other formatting plugins.
Automatically formats files when saving using either LSP or shell utilities like prettierd or shfmt
Ensures formatting completes before the file is saved, avoiding complex edge cases associated with asynchronous operations, as stated in the README's core principles.
Supports LSP formatters, shell utilities like prettierd, custom Lua functions, and lazy-loaded formatters, allowing flexible configuration for different filetypes and projects.
Automatically restores cursor positions across all windows displaying the current file, which is useful for split editing and enhances the user experience.
Allows customization of error notifications via built-in notifiers or custom implementations, such as using vim.notify for tailored error reporting.
The plugin is no longer maintained, as the author has switched to conform.nvim, leaving known bugs unfixed and no future updates, as highlighted in the README warning.
Forces all formatting to be synchronous, which can block the editor and cause delays with slower formatters, limiting flexibility for performance-sensitive workflows.
Missing planned features from the TODO list, such as file size limits, LSP timeout configuration, and better error handling for non-zero exit codes, reducing robustness.
Lightweight yet powerful formatter plugin for Neovim
:sparkles: A (Neo)vim plugin for formatting code.
Formatter.nvim is a Neovim plugin that runs external code formatters on your files. It provides a flexible and asynchronous way to format code across many languages, helping developers maintain consistent code style without leaving the editor. ## Key Features - **Asynchronous Execution** — Runs formatters in the background without blocking the editor. - **Buffer Locking** — Prevents modifications during formatting with lock commands. - **Opt-in Default Configurations** — Includes pre-built formatter setups for common filetypes that you can choose to use. - **Conditional Formatting** — Allows formatter configurations to include logic for when to run. - **Before/After Hooks** — Execute custom code before and after formatting via autocommands. - **Filetype-specific Setup** — Configure different formatters per filetype with ordered execution. ## Philosophy Formatter.nvim believes in providing a robust, non-blocking formatting experience while giving users full control over their configurations, avoiding assumptions about preferred tools.
Lightweight, fast and async formatting and linting plugin for Neovim
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.