All Projects → mhinz → Vim Mix Format

mhinz / Vim Mix Format

Licence: mit
Vim integration for the Elixir formatter.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Vim Mix Format

Nvim
The Ultimate NeoVim Config for Colemak Users
Stars: ✭ 754 (+284.69%)
Mutual labels:  neovim, vimrc
Dotfiles
Get ready for dotfiles. Contains i3, i3blocks, rofi, dunst, picom, vim, tmux, and zsh.
Stars: ✭ 985 (+402.55%)
Mutual labels:  neovim, vimrc
Thinkvim
Vim configuration in the 21st century
Stars: ✭ 832 (+324.49%)
Mutual labels:  neovim, vimrc
Mydotfiles
All my dot configuration files.
Stars: ✭ 359 (+83.16%)
Mutual labels:  neovim, vimrc
Vime
vime, an easy and structural config for (neo)vim users
Stars: ✭ 136 (-30.61%)
Mutual labels:  neovim, vimrc
Dotfiles
Configuration for Linux, Nix, i3, Kitty, Fish, Neovim and more
Stars: ✭ 379 (+93.37%)
Mutual labels:  neovim, vimrc
Vimrc
📝 Vim Configuration for nerds with vim-plug
Stars: ✭ 33 (-83.16%)
Mutual labels:  neovim, vimrc
vimrc
My neovim config
Stars: ✭ 43 (-78.06%)
Mutual labels:  vimrc, neovim
Alacritty Colorscheme
Change colorscheme of alacritty with ease.
Stars: ✭ 184 (-6.12%)
Mutual labels:  neovim, vimrc
Dotfiles
My dotfiles for Archlinux and Windows
Stars: ✭ 1,419 (+623.98%)
Mutual labels:  neovim, vimrc
Spacevim
A community-driven modular vim/neovim distribution - The ultimate vimrc
Stars: ✭ 17,558 (+8858.16%)
Mutual labels:  neovim, vimrc
Nvcode
An IDE layer for Neovim with sane defaults. Completely free and community driven.
Stars: ✭ 6,714 (+3325.51%)
Mutual labels:  neovim, vimrc
Vim Monokai Tasty
VIM Colour scheme
Stars: ✭ 279 (+42.35%)
Mutual labels:  neovim, vimrc
Neovim Init.vim
🏮 The perfect Neovim configuration for productive people who wants to level up their Vim experience with a clean, minimal-looking aesthetic, as well as a highly extensible, easily customizable set of popular tools and shortcuts to boost productivity. 🏮
Stars: ✭ 440 (+124.49%)
Mutual labels:  neovim, vimrc
dotfiles
My arch setup script and dotfiles
Stars: ✭ 37 (-81.12%)
Mutual labels:  vimrc, neovim
Ale Sensible
Pretty, responsive and smooth defaults for a sane ALE, gets you started in 30 seconds
Stars: ✭ 30 (-84.69%)
Mutual labels:  neovim, vimrc
nvim
Blazing fast neovim setup with 120 plugins.
Stars: ✭ 108 (-44.9%)
Mutual labels:  vimrc, neovim
nvimrc
vimrc for neovim written in lua
Stars: ✭ 99 (-49.49%)
Mutual labels:  vimrc, neovim
Vim.ana
The portable Vim IDE with all the trimmings, one-click installable on any standard box.
Stars: ✭ 37 (-81.12%)
Mutual labels:  neovim, vimrc
Vim Bootstrap
Vim Bootstrap is a generator that provides a simple method of generating a configuration for vim / neovim.
Stars: ✭ 1,870 (+854.08%)
Mutual labels:  neovim, vimrc

vim-mix-format

Elixir 1.6 introduced the formatter: mix format. This plugin makes it easy to run the formatter asynchronously from within Vim 8 and Neovim.

demo

Installation

Use your favorite plugin manager, e.g. vim-plug:

Plug 'mhinz/vim-mix-format'

Commands

  • To format the current file, use :MixFormat. Use :verb MixFormat to see the exact shell command used.

  • The formatter is not perfect yet, so :MixFormatDiff will open a diff window that can be used for previewing the changes or picking only those that seem reasonable.

    dp pushes changes from the diff window to the source file. q closes the diff window. ]c and [c jump between the changes.

    If you're not used to Vim's diff mode, watch this screencast.

Options

  • Automatically format on saving.

    let g:mix_format_on_save = 1
    
  • Set options for the formatter. See mix help format in the shell.

    let g:mix_format_options = '--check-equivalent'
    
  • By default this plugin opens a window containing the stacktrace on errors. With this option enabled, there will be just a short message in the command-line bar. The stacktrace can still be looked up via :messages.

    let g:mix_format_silent_errors = 1
    
  • If you're not using Elixir 1.6 in your project, but want to use the formatter anyway, you can specify the bin directory of an alternative Elixir installation:

    let g:mix_format_elixir_bin_path = '~/repo/elixir/bin'
    

Customization

When using :MixFormatDiff, a new diff window will be opened and an user event is emitted. It can be used to set different settings or switch back to the source window:

autocmd User MixFormatDiff wincmd p

Feedback

If you like this plugin, star it! It helps me deciding which projects to spend more time on.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].