A (Neo)vim plugin that formats code using external formatters for many filetypes without requiring a file save.
Neoformat is a (Neo)vim plugin that automatically formats code by interfacing with external code formatters for a wide variety of programming languages and file types. It solves the problem of inconsistent code styling by providing a single command to format buffers without saving files first, integrating seamlessly into the editor workflow.
Vim and Neovim users who want automated code formatting across multiple languages without leaving their editor, particularly developers working in polyglot codebases.
Developers choose Neoformat for its extensive formatter support, buffer-based operation that avoids file saves, and its ability to maintain editor state, offering a more integrated and reliable formatting experience compared to manual formatter invocations.
:sparkles: A (Neo)vim plugin for formatting code.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports over 70 filetypes with multiple external formatters like Prettier, Black, and gofmt, as detailed in the lengthy README list.
Uses getbufline() to format code directly from the buffer without requiring a file save, preserving unsaved changes.
Maintains marks, jumps, and undo history after formatting by using setline(), ensuring a seamless editing experience.
Allows defining multiple formatters per filetype and tries them sequentially until one succeeds, reducing formatting failures.
Requires each external formatter (e.g., prettier, black) to be installed and configured separately, adding significant setup overhead.
Setting up custom formatters involves defining variables with numerous options like exe, args, and stdin, which can be overwhelming and error-prone.
Formatters that don't support stdin write buffer data to /tmp/neoformat/, which may fail in environments with restricted file access or cleanup policies.