Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Neovim
  3. neoformat

neoformat

BSD-2-ClauseVim Scriptv0.4.0

A (Neo)vim plugin that formats code using external formatters for many filetypes without requiring a file save.

GitHubGitHub
2.0k stars180 forks0 contributors

What is neoformat?

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.

Target Audience

Vim and Neovim users who want automated code formatting across multiple languages without leaving their editor, particularly developers working in polyglot codebases.

Value Proposition

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.

Overview

:sparkles: A (Neo)vim plugin for formatting code.

Use Cases

Best For

  • Automatically formatting code in Vim/Neovim across dozens of languages with a single plugin
  • Integrating multiple code formatters (like Prettier, Black, gofmt) into a unified editor workflow
  • Formatting code without saving the file first to preserve unsaved changes
  • Maintaining editor state (marks, jumps) after running code formatters
  • Configuring custom formatters with specific arguments and environment variables
  • Setting up format-on-save functionality for consistent code style

Not Ideal For

  • Environments where writing to /tmp is restricted, such as sandboxed containers or security-focused systems
  • Teams seeking a zero-configuration formatting solution without managing external formatter installations
  • Projects requiring real-time, as-you-type formatting integrated with language servers or other IDE features

Pros & Cons

Pros

Extensive Formatter Support

Supports over 70 filetypes with multiple external formatters like Prettier, Black, and gofmt, as detailed in the lengthy README list.

Buffer-Based Operation

Uses getbufline() to format code directly from the buffer without requiring a file save, preserving unsaved changes.

State Preservation

Maintains marks, jumps, and undo history after formatting by using setline(), ensuring a seamless editing experience.

Configurable Fallbacks

Allows defining multiple formatters per filetype and tries them sequentially until one succeeds, reducing formatting failures.

Cons

External Dependency Burden

Requires each external formatter (e.g., prettier, black) to be installed and configured separately, adding significant setup overhead.

Complex Configuration

Setting up custom formatters involves defining variables with numerous options like exe, args, and stdin, which can be overwhelming and error-prone.

File System Reliance

Formatters that don't support stdin write buffer data to /tmp/neoformat/, which may fail in environments with restricted file access or cleanup policies.

Frequently Asked Questions

Quick Stats

Stars2,047
Forks180
Contributors0
Open Issues115
Last commit4 months ago
CreatedSince 2016

Tags

#plugin-manager#editor-tool#vim#buffer-management#neovim-plugin#plugin#developer-productivity#code-formatting#neovim#formatter#vim-plugin

Built With

V
Vimscript

Included in

Neovim20.6k
Auto-fetched 7 hours ago

Related Projects

conform.nvimconform.nvim

Lightweight yet powerful formatter plugin for Neovim

Stars5,332
Forks310
Last commit27 days ago
formatter.nvimformatter.nvim

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.

Stars1,449
Forks145
Last commit1 year ago
guard.nvimguard.nvim

Lightweight, fast and async formatting and linting plugin for Neovim

Stars518
Forks27
Last commit7 months ago
prettier.nvimprettier.nvim

Prettier plugin for Neovim's built-in LSP client.

Stars316
Forks10
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub