diff --git a/README.md b/README.md index 8611421..613e992 100644 --- a/README.md +++ b/README.md @@ -228,10 +228,14 @@ Here is a list of formatprograms that are supported by default, and thus will be * `fprettify` for modern __Fortran__. Download from [official repository](https://github.com/pseewald/fprettify). Install with `./setup.py install` or `./setup.py install --user`. +* `mix format` for __Elixir__. + `mix format` is included with Elixir 1.6+. + * `fixjson` for JSON. It is a JSON file fixer/formatter for humans using (relaxed) JSON5. It fixes various failures while humans writing JSON and formats JSON codes. It can be installed with `npm install -g fixjson`. More info is available at https://github.com/rhysd/fixjson. + ## Help, the formatter doesn't work as expected! If you're struggling with getting a formatter to work, it may help to set vim-autoformat in diff --git a/plugin/defaults.vim b/plugin/defaults.vim index 1c39799..c5f4451 100644 --- a/plugin/defaults.vim +++ b/plugin/defaults.vim @@ -444,3 +444,12 @@ endif if !exists('g:formatters_fortran') let g:formatters_fortran = ['fprettify'] endif + +" Elixir +if !exists('g:formatdef_mix_format') + let g:formatdef_mix_format = '"mix format -"' +endif + +if !exists('g:formatters_elixir') + let g:formatters_elixir = ['mix_format'] +endif