Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

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

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Elixir
  3. vim-mix-format

vim-mix-format

MITVim Script

Vim plugin for asynchronous Elixir code formatting using mix format.

GitHubGitHub
220 stars12 forks0 contributors

What is vim-mix-format?

vim-mix-format is a Vim plugin that integrates Elixir's mix format command directly into Vim 8 and Neovim. It allows developers to format Elixir code asynchronously from within their editor, ensuring code consistency without interrupting workflow. The plugin supports features like automatic formatting on save and a diff preview for reviewing changes.

Target Audience

Elixir developers who use Vim or Neovim as their primary editor and want seamless, non-blocking code formatting integrated into their development environment.

Value Proposition

Developers choose vim-mix-format for its lightweight, asynchronous integration of Elixir's official formatter, offering customization options and diff previews without the overhead of external tools or manual formatting processes.

Overview

Vim integration for the Elixir formatter.

Use Cases

Best For

  • Formatting Elixir code automatically on save in Vim/Neovim
  • Reviewing formatting changes with a diff preview before applying
  • Integrating Elixir's mix format into a Vim-based workflow
  • Using asynchronous formatting to avoid editor blocking
  • Customizing formatter options for specific Elixir projects
  • Working with multiple Elixir versions in different projects

Not Ideal For

  • Developers using editors other than Vim 8 or Neovim, such as VSCode or IntelliJ with built-in Elixir support
  • Teams that enforce formatting solely through CI/CD pipelines or pre-commit hooks without editor integration
  • Projects not written in Elixir or using Elixir versions below 1.6 without an accessible alternative installation
  • Users who prefer graphical diff tools or find Vim's diff mode challenging for reviewing changes

Pros & Cons

Pros

Asynchronous Formatting

Runs mix format in the background without blocking the editor, allowing continuous work as demonstrated in the demo GIF, improving workflow efficiency.

Automatic Save Formatting

Can be configured with `let g:mix_format_on_save = 1` to format files automatically on save, ensuring consistent code style with minimal effort.

Diff Preview Control

Provides `:MixFormatDiff` to open a diff window for previewing changes, with commands like `dp` to apply selectively, enhancing user control over formatting.

Flexible Configuration

Supports custom formatter options via `g:mix_format_options` and error handling with `g:mix_format_silent_errors`, allowing tailored integration for different projects.

Cons

Vim-Only Compatibility

Limited to Vim 8 and Neovim, excluding users of other editors or older Vim versions, which restricts its applicability in diverse development environments.

Elixir Version Dependency

Requires Elixir 1.6+; for older versions, users must manually specify an alternative path with `g:mix_format_elixir_bin_path`, adding setup complexity.

Diff Mode Learning Curve

The diff preview relies on Vim's native diff mode, which may be unfamiliar to some users, as hinted by the README linking to external resources for guidance.

Frequently Asked Questions

Quick Stats

Stars220
Forks12
Contributors0
Open Issues7
Last commit3 years ago
CreatedSince 2017

Tags

#elixir-lang#elixir#elixir-tooling#editor-integration#vim#asynchronous#neovim-plugin#code-formatting#neovim#vimrc#vim-plugin

Built With

V
Vim
N
Neovim
E
Elixir

Included in

Elixir13.1k
Auto-fetched 1 day ago

Related Projects

JetbrainsJetbrains

Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)

Stars1,898
Forks164
Last commit1 day ago
vim-elixirvim-elixir

Vim configuration files for Elixir

Stars1,326
Forks154
Last commit1 year ago
AlchemistAlchemist

Elixir Tooling Integration Into Emacs

Stars913
Forks102
Last commit4 years ago
elixir-lselixir-ls

A frontend-independent IDE "smartness" server for Elixir. Implements the JSON-based "Language Server Protocol" standard and provides debugger support via VS Code's debugger protocol.

Stars844
Forks49
Last commit6 years 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