@@ -31,7 +31,7 @@ Or specify a certain formatter (must be defined for the current filetype)
3131
3232Or format a visual selection of code in a different filetype
3333
34- __ Note: __ you must use a ! and pass the filetype of the selection
34+ ** Note: ** you must use a ! and pass the filetype of the selection
3535
3636``` viml
3737:Neoformat! python
@@ -58,7 +58,7 @@ The `undojoin` command will put changes made by Neoformat into the same
5858
5959## Install
6060
61- [ vim-plug] ( https://github.com/junegunn/vim-plug )
61+ The best way to install Neoformat is with your favorite plugin manager for Vim, such as [ vim-plug] ( https://github.com/junegunn/vim-plug ) :
6262
6363``` viml
6464Plug 'sbdchd/neoformat'
@@ -76,16 +76,17 @@ Define custom formatters.
7676
7777Options:
7878
79- | name | description | default | optional / required |
80- | ------------------ | ----------------------------------------------------------------------------------------------------------------- | ------- | ------------------- |
81- | ` exe ` | the name the formatter executable in the path | n/a | ** required** |
82- | ` args ` | list of arguments | \[ ] | optional |
83- | ` replace ` | overwrite the file, instead of updating the buffer | 0 | optional |
84- | ` stdin ` | send data to the stdin of the formatter | 0 | optional |
85- | ` stderr ` | capture stderr output from formatter | 0 | optional |
86- | ` no_append ` | do not append the ` path ` of the file to the formatter command, used when the ` path ` is in the middle of a command | 0 | optional |
87- | ` env ` | list of environment variable definitions to be prepended to the formatter command | \[ ] | optional |
88- | ` valid_exit_codes ` | list of valid exit codes for formatters who do not respect common unix practices | \[ 0] | optional |
79+ | name | description | default | optional / required |
80+ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------------------- |
81+ | ` exe ` | the name the formatter executable in the path | n/a | ** required** |
82+ | ` args ` | list of arguments | \[ ] | optional |
83+ | ` replace ` | overwrite the file, instead of updating the buffer | 0 | optional |
84+ | ` stdin ` | send data to the stdin of the formatter | 0 | optional |
85+ | ` stderr ` | capture stderr output from formatter | 0 | optional |
86+ | ` no_append ` | do not append the ` path ` of the file to the formatter command, used when the ` path ` is in the middle of a command | 0 | optional |
87+ | ` env ` | list of environment variable definitions to be prepended to the formatter command | \[ ] | optional |
88+ | ` valid_exit_codes ` | list of valid exit codes for formatters who do not respect common unix practices | \[ 0] | optional |
89+ | ` try_node_exe ` | attempt to find ` exe ` in a ` node_modules/.bin ` directory in the current working directory or one of its parents (requires setting ` g:neoformat_try_node_exe ` ) | 0 | optional |
8990
9091Example:
9192
@@ -157,6 +158,14 @@ let g:neoformat_verbose = 1 " only affects the verbosity of Neoformat
157158let &verbose = 1 " also increases verbosity of the editor as a whole
158159```
159160
161+ Have Neoformat look for a formatter executable in the ` node_modules/.bin `
162+ directory in the current working directory or one of its parents (only applies
163+ to formatters with ` try_node_exe ` set to ` 1 ` ):
164+
165+ ``` viml
166+ let g:neoformat_try_node_exe = 1
167+ ```
168+
160169## Adding a New Formatter
161170
162171Note: you should replace everything ` {{ }} ` accordingly
@@ -218,17 +227,24 @@ that caused Neoformat to be invoked.
218227 - [ ` asmfmt ` ] ( https://github.com/klauspost/asmfmt )
219228- Bazel
220229 - [ ` buildifier ` ] ( https://github.com/bazelbuild/buildtools/blob/master/buildifier/README.md )
230+ - Beancount
231+ - [ ` bean-format ` ] ( https://beancount.github.io/docs/running_beancount_and_generating_reports.html#bean-format )
232+ - Bib
233+ - [ bibclean] ( https://github.com/tobywf/bibclean )
221234- C
222235 - [ ` uncrustify ` ] ( http://uncrustify.sourceforge.net ) ,
223236 [ ` clang-format ` ] ( http://clang.llvm.org/docs/ClangFormat.html ) ,
224237 [ ` astyle ` ] ( http://astyle.sourceforge.net )
225238- C#
226239 - [ ` uncrustify ` ] ( http://uncrustify.sourceforge.net ) ,
227- [ ` astyle ` ] ( http://astyle.sourceforge.net )
240+ [ ` astyle ` ] ( http://astyle.sourceforge.net ) ,
241+ [ ` clang-format ` ] ( http://clang.llvm.org/docs/ClangFormat.html )
228242- C++
229243 - [ ` uncrustify ` ] ( http://uncrustify.sourceforge.net ) ,
230244 [ ` clang-format ` ] ( http://clang.llvm.org/docs/ClangFormat.html ) ,
231245 [ ` astyle ` ] ( http://astyle.sourceforge.net )
246+ - Cabal
247+ - [ ` cabal-fmt ` ] ( https://github.com/phadej/cabal-fmt )
232248- CMake
233249 - [ ` cmake_format ` ] ( https://github.com/cheshirekow/cmake_format )
234250- Crystal
@@ -242,33 +258,73 @@ that caused Neoformat to be invoked.
242258 [ ` prettier ` ] ( https://github.com/prettier/prettier )
243259- CSV
244260 - [ ` prettydiff ` ] ( https://github.com/prettydiff/prettydiff )
261+ - Cue
262+ - [ ` cue fmt ` ] ( https://cuelang.org/ )
245263- D
246264 - [ ` uncrustify ` ] ( http://uncrustify.sourceforge.net ) ,
247265 [ ` dfmt ` ] ( https://github.com/Hackerpilot/dfmt )
248266- Dart
249267 - [ ` dartfmt ` ] ( https://www.dartlang.org/tools/ )
268+ - [ ` dart format ` ] ( https://dart.dev/tools/dart-format )
250269- Dhall
251270 - [ ` dhall format ` ] ( https://dhall-lang.org )
252271- dune
253272 - [ ` dune format ` ] ( https://github.com/ocaml/dune )
273+ - Ebuild
274+ - [ ` shfmt ` ] ( https://github.com/mvdan/sh )
275+ ``` vim
276+ let g:shfmt_opt="-ci"
277+ ```
254278- Elixir
255279 - [`mix format`](https://hexdocs.pm/mix/master/Mix.Tasks.Format.html)
256280- Elm
257281 - [`elm-format`](https://github.com/avh4/elm-format)
282+ - Erlang
283+ - [`erlfmt`](https://github.com/WhatsApp/erlfmt)
258284- Fish
259285 - [`fish_indent`](http://fishshell.com)
286+ - Fortran
287+ - [`fprettify`](https://github.com/pseewald/fprettify)
288+ - F#
289+ - [`fantomas`](https://github.com/fsprojects/fantomas)
290+ - GDScript
291+ - [`gdformat`](https://github.com/Scony/godot-gdscript-toolkit)
292+ - Gleam
293+ - [`gleam format`](https://github.com/gleam-lang/gleam/)
260294- Go
261295 - [`gofmt`](https://golang.org/cmd/gofmt/),
262- [ ` goimports ` ] ( https://godoc.org/golang.org/x/tools/cmd/goimports )
296+ [`goimports`](https://godoc.org/golang.org/x/tools/cmd/goimports),
297+ [`gofumpt`](https://github.com/mvdan/gofumpt),
298+ [`gofumports`](https://github.com/mvdan/gofumpt)
299+ - GLSL
300+ - [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html)
263301- GraphQL
264302 - [`prettier`](https://github.com/prettier/prettier)
265303- Haskell
266- - [ ` stylish-haskell ` ] ( https://github.com/jaspervdj/stylish-haskell ) ,
304+ - [`stylishhaskell `](https://github.com/jaspervdj/stylish-haskell),
267305 [`hindent`](https://github.com/chrisdone/hindent),
268306 [`hfmt`](https://github.com/danstiner/hfmt),
269307 [`brittany`](https://github.com/lspitzner/brittany),
270- [ ` sort-imports ` ] ( https://github.com/evanrelf/sort-imports ) ,
308+ [`sortimports `](https://github.com/evanrelf/sort-imports),
271309 [`floskell`](https://github.com/ennocramer/floskell)
310+ [`ormolu`](https://github.com/tweag/ormolu)
311+ ```vim
312+ let g:ormolu_ghc_opt=["TypeApplications", "RankNTypes"]
313+ ```
314+ - You must use formatter's name without "`-`"
315+ ```vim
316+ " right
317+ let g:neoformat_enabled_haskell = ['sortimports', 'stylishhaskell']
318+ " wrong
319+ let g:neoformat_enabled_haskell = ['sort-imports', 'stylish-haskell']
320+ ```
321+ - Toml
322+ - [`taplo`](https://taplo.tamasfe.dev/cli)
323+ - Puppet
324+ - [`puppet-lint`](https://github.com/rodjek/puppet-lint)
325+ - PureScript
326+ - [`purs-tidy`](https://github.com/natefaubion/purescript-tidy)
327+ - [`purty`](https://gitlab.com/joneshf/purty)
272328- HTML
273329 - `html-beautify` (ships with [`js-beautify`](https://github.com/beautify-web/js-beautify)),
274330 [`prettier`](https://github.com/prettier/prettier),
@@ -277,24 +333,32 @@ that caused Neoformat to be invoked.
277333 - [`pug-beautifier`](https://github.com/vingorius/pug-beautifier)
278334- Java
279335 - [`uncrustify`](http://uncrustify.sourceforge.net),
280- [ ` astyle ` ] ( http://astyle.sourceforge.net )
281- - Javascript
336+ [`astyle`](http://astyle.sourceforge.net),
337+ [`prettier`](https://github.com/prettier/prettier)
338+ - JavaScript
282339 - [`js-beautify`](https://github.com/beautify-web/js-beautify),
283340 [`prettier`](https://github.com/prettier/prettier),
284341 [`prettydiff`](https://github.com/prettydiff/prettydiff),
285342 [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html),
286343 [`esformatter`](https://github.com/millermedeiros/esformatter/),
287344 [`prettier-eslint`](https://github.com/kentcdodds/prettier-eslint-cli),
288- [ ` eslint_d ` ] ( https://github.com/mantoni/eslint_d.js )
289- [ ` standard ` ] ( https://standardjs.com/ )
345+ [`eslint_d`](https://github.com/mantoni/eslint_d.js),
346+ [`standard`](https://standardjs.com/),
347+ [`semistandard`](https://github.com/standard/semistandard),
348+ [`deno fmt`](https://deno.land/manual/tools/formatter)
290349- JSON
291350 - [`js-beautify`](https://github.com/beautify-web/js-beautify),
292351 [`prettydiff`](https://github.com/prettydiff/prettydiff),
293352 [`prettier`](https://github.com/prettier/prettier),
294353 [`jq`](https://stedolan.github.io/jq/),
295354 [`fixjson`](https://github.com/rhysd/fixjson)
355+ [`deno fmt`](https://deno.land/manual/tools/formatter)
356+ - JSONC (JSON with comments)
357+ - [`prettier`](https://github.com/prettier/prettier)
358+ [`deno fmt`](https://deno.land/manual/tools/formatter)
296359- Kotlin
297- - [ ` ktlint ` ] ( https://github.com/shyiko/ktlint )
360+ - [`ktlint`](https://github.com/shyiko/ktlint),
361+ [`prettier`](https://github.com/prettier/prettier)
298362- LaTeX
299363 - [`latexindent`](https://github.com/cmhughes/latexindent.pl)
300364- Less
@@ -304,11 +368,22 @@ that caused Neoformat to be invoked.
304368 [`stylelint`](https://stylelint.io/)
305369- Lua
306370 - [`luaformatter`](https://github.com/LuaDevelopmentTools/luaformatter)
371+ - [`lua-fmt`](https://github.com/trixnz/lua-fmt)
372+ - [`lua-format`](https://github.com/Koihik/LuaFormatter)
373+ - [`stylua`](https://github.com/JohnnyMorganz/StyLua)
307374- Markdown
308375 - [`remark`](https://github.com/wooorm/remark)
309376 [`prettier`](https://github.com/prettier/prettier)
377+ [`deno fmt`](https://deno.land/manual/tools/formatter)
378+ - Matlab
379+ - [`matlab-formatter-vscode`](https://github.com/affenwiesel/matlab-formatter-vscode)
380+ - Nginx
381+ - [nginxbeautifier](https://github.com/vasilevich/nginxbeautifier)
310382- Nim
311383 - `nimpretty` (ships with [`nim`](https://nim-lang.org/))
384+ - Nix
385+ - [`nixfmt`](https://github.com/serokell/nixfmt)
386+ - [`nixpkgs-fmt`](https://github.com/nix-community/nixpkgs-fmt)
312387- Objective-C
313388 - [`uncrustify`](http://uncrustify.sourceforge.net),
314389 [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html),
@@ -326,14 +401,17 @@ that caused Neoformat to be invoked.
326401 - [`php_beautifier`](http://pear.php.net/package/PHP_Beautifier),
327402 [`php-cs-fixer`](http://cs.sensiolabs.org/),
328403 [`phpcbf`](https://github.com/squizlabs/PHP_CodeSniffer)
404+ - PowerShell
405+ - [`PSScriptAnalyzer`](https://github.com/PowerShell/PSScriptAnalyzer),
406+ [`PowerShell-Beautifier`](https://github.com/DTW-DanWard/PowerShell-Beautifier)
329407- Proto
330408 - [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html)
331409- Pug (formally Jade)
332410 - [`pug-beautifier`](https://github.com/vingorius/pug-beautifier)
333411- Python
334412 - [`yapf`](https://github.com/google/yapf),
335413 [`autopep8`](https://github.com/hhatto/autopep8),
336- [ ` black ` ] ( https://github.com/ambv /black ) ,
414+ [`black`](https://github.com/psf /black),
337415 [`pydevf`](https://github.com/fabioz/PyDev.Formatter),
338416 [`isort`](https://github.com/timothycrosley/isort),
339417 [`docformatter`](https://github.com/myint/docformatter),
@@ -343,6 +421,7 @@ that caused Neoformat to be invoked.
343421 [`formatR`](https://github.com/yihui/formatR)
344422- Reason
345423 - [`refmt`](https://github.com/facebook/reason)
424+ - [`bsrefmt`](https://github.com/bucklescript/bucklescript)
346425- Ruby
347426 - [`rufo`](https://github.com/ruby-formatter/rufo),
348427 [`ruby-beautify`](https://github.com/erniebrodeur/ruby-beautify),
@@ -367,18 +446,31 @@ that caused Neoformat to be invoked.
367446 [`prettier`](https://github.com/prettier/prettier)
368447- Shell
369448 - [`shfmt`](https://github.com/mvdan/sh)
449+ ```vim
450+ let g:shfmt_opt="-ci"
451+ ```
370452- SQL
371453 - [`sqlfmt`](https://github.com/jackc/sqlfmt),
372454 `sqlformat` (ships with [sqlparse](https://github.com/andialbrecht/sqlparse)),
373455 `pg_format` (ships with [pgFormatter](https://github.com/darold/pgFormatter))
456+ - Starlark
457+ - [`buildifier`](https://github.com/bazelbuild/buildtools/blob/master/buildifier/README.md)
458+ - Svelte
459+ - [`prettier-plugin-svelte`](https://github.com/UnwrittenFun/prettier-plugin-svelte)
374460- Swift
375461 - [`Swiftformat`](https://github.com/nicklockwood/SwiftFormat)
376462- Terraform
377463 - [`terraform`](https://www.terraform.io/docs/commands/fmt.html),
378- - Typescript
464+ - TypeScript
379465 - [`tsfmt`](https://github.com/vvakame/typescript-formatter),
380466 [`prettier`](https://github.com/prettier/prettier),
381- [ ` tslint ` ] ( https://palantir.github.io/tslint )
467+ [`prettier-eslint`](https://github.com/kentcdodds/prettier-eslint-cli),
468+ [`tslint`](https://palantir.github.io/tslint),
469+ [`eslint_d`](https://github.com/mantoni/eslint_d.js),
470+ [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html),
471+ [`deno fmt`](https://deno.land/manual/tools/formatter)
472+ - V
473+ - `v fmt` (ships with [`v`](https://vlang.io))
382474- VALA
383475 - [`uncrustify`](http://uncrustify.sourceforge.net)
384476- Vue
@@ -388,7 +480,15 @@ that caused Neoformat to be invoked.
388480 [`prettydiff`](https://github.com/prettydiff/prettydiff)
389481- XML
390482 - [`tidy`](http://www.html-tidy.org),
391- [ ` prettydiff ` ] ( https://github.com/prettydiff/prettydiff )
483+ [`prettydiff`](https://github.com/prettydiff/prettydiff),
484+ [`prettier`](https://github.com/prettier/prettier)
392485- YAML
393486 - [`pyaml`](https://pypi.python.org/pypi/pyaml),
394487 [`prettier`](https://github.com/prettier/prettier)
488+ - zig
489+ - [`zig fmt`](https://github.com/ziglang/zig)
490+ - zsh
491+ - [`shfmt`](https://github.com/mvdan/sh)
492+ ```vim
493+ let g:shfmt_opt="-ci"
494+ ```
0 commit comments