diff --git a/bundle/README.md b/bundle/README.md index 6bc9d7d77..621f0fc31 100644 --- a/bundle/README.md +++ b/bundle/README.md @@ -1,7 +1,8 @@ ## Forked repos -- [defx.nvim](https://github.com/Shougo/defx.nvim/commit/df5e6ea6734dc002919ea41786668069fa0b497d) -- [dein.vim](https://github.com/Shougo/dein.vim/commit/772ae08cef5e712b2b31b4aaee908fc853accd94) +- [defx.nvim](https://github.com/Shougo/defx.nvim/tree/df5e6ea6734dc002919ea41786668069fa0b497d) +- [dein.vim](https://github.com/Shougo/dein.vim/tree/772ae08cef5e712b2b31b4aaee908fc853accd94) +- [neoformat](https://github.com/sbdchd/neoformat/tree/1a49552cdaddeaaa766a6f0016effe530634b39f) ### checkers layer diff --git a/bundle/neoformat/.kodiak.toml b/bundle/neoformat/.kodiak.toml new file mode 100644 index 000000000..5f495a9ac --- /dev/null +++ b/bundle/neoformat/.kodiak.toml @@ -0,0 +1,5 @@ +version = 1 + +[merge.message] +title = "pull_request_title" +body = "pull_request_body" diff --git a/bundle/neoformat/README.md b/bundle/neoformat/README.md index 3320e9a72..09794f1c9 100644 --- a/bundle/neoformat/README.md +++ b/bundle/neoformat/README.md @@ -57,9 +57,7 @@ The `undojoin` command will put changes made by Neoformat into the same [Managing Undo History](#managing-undo-history). ## Install - -[vim-plug](https://github.com/junegunn/vim-plug) - +The best way to install Neoformat is with your favorite plugin manager for Vim, such as [vim-plug](https://github.com/junegunn/vim-plug): ```viml Plug 'sbdchd/neoformat' ``` @@ -106,9 +104,7 @@ let g:neoformat_enabled_python = ['autopep8'] Configure enabled formatters. ```viml - -let g:neoformat_enabled_python = ['autopep8', 'yapf', 'docformatter', 'autoflake'] - +let g:neoformat_enabled_python = ['autopep8', 'yapf', 'docformatter'] ``` Have Neoformat use &formatprg as a formatter @@ -220,17 +216,24 @@ that caused Neoformat to be invoked. - [`asmfmt`](https://github.com/klauspost/asmfmt) - Bazel - [`buildifier`](https://github.com/bazelbuild/buildtools/blob/master/buildifier/README.md) +- Beancount + - [`bean-format`](https://beancount.github.io/docs/running_beancount_and_generating_reports.html#bean-format) +- Bib + - [bibclean](https://github.com/tobywf/bibclean) - C - [`uncrustify`](http://uncrustify.sourceforge.net), [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html), [`astyle`](http://astyle.sourceforge.net) - C# - [`uncrustify`](http://uncrustify.sourceforge.net), - [`astyle`](http://astyle.sourceforge.net) + [`astyle`](http://astyle.sourceforge.net), + [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html) - C++ - [`uncrustify`](http://uncrustify.sourceforge.net), [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html), [`astyle`](http://astyle.sourceforge.net) +- Cabal + - [`cabal-fmt`](https://github.com/phadej/cabal-fmt) - CMake - [`cmake_format`](https://github.com/cheshirekow/cmake_format) - Crystal @@ -257,26 +260,45 @@ that caused Neoformat to be invoked. - [`mix format`](https://hexdocs.pm/mix/master/Mix.Tasks.Format.html) - Elm - [`elm-format`](https://github.com/avh4/elm-format) +- Erlang + - [`erlfmt`](https://github.com/WhatsApp/erlfmt) - Fish - [`fish_indent`](http://fishshell.com) +- F# + - [`fantomas`](https://github.com/fsprojects/fantomas) +- GDScript + - [`gdformat`](https://github.com/Scony/godot-gdscript-toolkit) +- Gleam + - [`gleam format`](https://github.com/gleam-lang/gleam/) - Go - [`gofmt`](https://golang.org/cmd/gofmt/), - [`goimports`](https://godoc.org/golang.org/x/tools/cmd/goimports) + [`goimports`](https://godoc.org/golang.org/x/tools/cmd/goimports), + [`gofumpt`](https://github.com/mvdan/gofumpt), + [`gofumports`](https://github.com/mvdan/gofumpt) - GLSL - [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html) - GraphQL - [`prettier`](https://github.com/prettier/prettier) - Haskell - - [`stylish-haskell`](https://github.com/jaspervdj/stylish-haskell), + - [`stylishhaskell`](https://github.com/jaspervdj/stylish-haskell), [`hindent`](https://github.com/chrisdone/hindent), [`hfmt`](https://github.com/danstiner/hfmt), [`brittany`](https://github.com/lspitzner/brittany), - [`sort-imports`](https://github.com/evanrelf/sort-imports), + [`sortimports`](https://github.com/evanrelf/sort-imports), [`floskell`](https://github.com/ennocramer/floskell) [`ormolu`](https://github.com/tweag/ormolu) ```vim let g:ormolu_ghc_opt=["TypeApplications", "RankNTypes"] ``` + - You must use formatter's name without "`-`" + ```vim + " right + let g:neoformat_enabled_haskell = ['sortimports', 'stylishhaskell'] + " wrong + let g:neoformat_enabled_haskell = ['sort-imports', 'stylish-haskell'] + ``` +- Puppet + - [`puppet-lint`](https://github.com/rodjek/puppet-lint) - PureScript - [`purty`](https://gitlab.com/joneshf/purty) - HTML @@ -296,8 +318,10 @@ that caused Neoformat to be invoked. [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html), [`esformatter`](https://github.com/millermedeiros/esformatter/), [`prettier-eslint`](https://github.com/kentcdodds/prettier-eslint-cli), - [`eslint_d`](https://github.com/mantoni/eslint_d.js) - [`standard`](https://standardjs.com/) + [`eslint_d`](https://github.com/mantoni/eslint_d.js), + [`standard`](https://standardjs.com/), + [`semistandard`](https://github.com/standard/semistandard), + [`deno fmt`](https://deno.land/manual/tools/formatter), - JSON - [`js-beautify`](https://github.com/beautify-web/js-beautify), [`prettydiff`](https://github.com/prettydiff/prettydiff), @@ -317,15 +341,19 @@ that caused Neoformat to be invoked. - Lua - [`luaformatter`](https://github.com/LuaDevelopmentTools/luaformatter) - [`lua-fmt`](https://github.com/trixnz/lua-fmt) + - [`lua-format`](https://github.com/Koihik/LuaFormatter) - Markdown - [`remark`](https://github.com/wooorm/remark) [`prettier`](https://github.com/prettier/prettier) - Matlab - [`matlab-formatter-vscode`](https://github.com/affenwiesel/matlab-formatter-vscode) +- Nginx + - [nginxbeautifier](https://github.com/vasilevich/nginxbeautifier) - Nim - `nimpretty` (ships with [`nim`](https://nim-lang.org/)) - Nix - [`nixfmt`](https://github.com/serokell/nixfmt) + - [`nixpkgs-fmt`](https://github.com/nix-community/nixpkgs-fmt) - Objective-C - [`uncrustify`](http://uncrustify.sourceforge.net), [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html), @@ -343,6 +371,9 @@ that caused Neoformat to be invoked. - [`php_beautifier`](http://pear.php.net/package/PHP_Beautifier), [`php-cs-fixer`](http://cs.sensiolabs.org/), [`phpcbf`](https://github.com/squizlabs/PHP_CodeSniffer) +- PowerShell + - [`PSScriptAnalyzer`](https://github.com/PowerShell/PSScriptAnalyzer), + [`PowerShell-Beautifier`](https://github.com/DTW-DanWard/PowerShell-Beautifier) - Proto - [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html) - Pug (formally Jade) @@ -350,17 +381,17 @@ that caused Neoformat to be invoked. - Python - [`yapf`](https://github.com/google/yapf), [`autopep8`](https://github.com/hhatto/autopep8), - [`black`](https://github.com/ambv/black) - [`pydevf`](https://github.com/fabioz/PyDev.Formatter) - - [`isort`](https://github.com/timothycrosley/isort) - - [`docformatter`](https://github.com/myint/docformatter) - - [`pyment`](https://github.com/dadadel/pyment) - - [`autoflake`](https://github.com/myint/autoflake) + [`black`](https://github.com/psf/black), + [`pydevf`](https://github.com/fabioz/PyDev.Formatter), + [`isort`](https://github.com/timothycrosley/isort), + [`docformatter`](https://github.com/myint/docformatter), + [`pyment`](https://github.com/dadadel/pyment) - R - [`styler`](https://github.com/r-lib/styler), [`formatR`](https://github.com/yihui/formatR) - Reason - [`refmt`](https://github.com/facebook/reason) + - [`bsrefmt`](https://github.com/bucklescript/bucklescript) - Ruby - [`rufo`](https://github.com/ruby-formatter/rufo), [`ruby-beautify`](https://github.com/erniebrodeur/ruby-beautify), @@ -403,9 +434,13 @@ that caused Neoformat to be invoked. - TypeScript - [`tsfmt`](https://github.com/vvakame/typescript-formatter), [`prettier`](https://github.com/prettier/prettier), - [`tslint`](https://palantir.github.io/tslint) - [`eslint_d`](https://github.com/mantoni/eslint_d.js) + [`prettier-eslint`](https://github.com/kentcdodds/prettier-eslint-cli), + [`tslint`](https://palantir.github.io/tslint), + [`eslint_d`](https://github.com/mantoni/eslint_d.js), [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html), + [`deno fmt`](https://deno.land/manual/tools/formatter) +- V + - `v fmt` (ships with [`v`](https://vlang.io)) - VALA - [`uncrustify`](http://uncrustify.sourceforge.net) - Vue @@ -420,3 +455,10 @@ that caused Neoformat to be invoked. - YAML - [`pyaml`](https://pypi.python.org/pypi/pyaml), [`prettier`](https://github.com/prettier/prettier) +- zig + - [`zig fmt`](https://github.com/ziglang/zig) +- zsh + - [`shfmt`](https://github.com/mvdan/sh) + ```vim + let g:shfmt_opt="-ci" + ``` diff --git a/bundle/neoformat/autoload/neoformat.vim b/bundle/neoformat/autoload/neoformat.vim index f6c86576e..cd084c0a7 100644 --- a/bundle/neoformat/autoload/neoformat.vim +++ b/bundle/neoformat/autoload/neoformat.vim @@ -1,13 +1,18 @@ function! neoformat#Neoformat(bang, user_input, start_line, end_line) abort - let search = @/ let view = winsaveview() + let search = @/ let original_filetype = &filetype call s:neoformat(a:bang, a:user_input, a:start_line, a:end_line) + " Setting &filetype might destroy existing folds, so only do that + " if the filetype got changed (which can only be possible when + " invoking with a bang) + if a:bang && &filetype != original_filetype + let &filetype = original_filetype + endif let @/ = search call winrestview(view) - let &filetype = original_filetype endfunction function! s:neoformat(bang, user_input, start_line, end_line) abort @@ -92,8 +97,7 @@ function! s:neoformat(bang, user_input, start_line, end_line) abort endif " read from /tmp file if formatter replaces file on format - " make sure cmd.tmp_file_path is readable - if (cmd.replace || len(stdout) == 0) && filereadable(cmd.tmp_file_path) + if cmd.replace let stdout = readfile(cmd.tmp_file_path) endif @@ -137,10 +141,10 @@ function! s:neoformat(bang, user_input, start_line, end_line) abort endif endfor if len(formatters_failed) > 0 - call neoformat#utils#msg('formatters ' . join(formatters_failed, ", ") . ' failed to run') + call neoformat#utils#msg('formatters ' . join(formatters_failed, ', ') . ' failed to run') endif if len(formatters_changed) > 0 - call neoformat#utils#msg(join(formatters_changed, ", ") . ' formatted buffer') + call neoformat#utils#msg(join(formatters_changed, ', ') . ' formatted buffer') elseif len(formatters_failed) == 0 call neoformat#utils#msg('no change necessary') endif @@ -192,7 +196,7 @@ function! neoformat#CompleteFormatters(ArgLead, CmdLine, CursorPos) abort \ "fnamemodify(v:val, ':t:r')"))), \ "v:val =~? '^" . a:ArgLead . "'") endif - if a:ArgLead =~ '[^A-Za-z0-9]' + if a:ArgLead =~# '[^A-Za-z0-9]' return [] endif let filetype = s:split_filetypes(&filetype) @@ -222,7 +226,13 @@ function! s:generate_cmd(definition, filetype) abort call neoformat#utils#log('no exe field in definition') return {} endif - if !executable(executable) + + if &shell =~# '\v%(powershell|pwsh)' + if system('[bool](Get-Command ' . executable . ' -ErrorAction SilentlyContinue)') !~# 'True' + call neoformat#utils#log('executable: ' . executable . ' is not a cmdlet, function, script file, or an executable program') + return {} + endif + elseif !executable(executable) call neoformat#utils#log('executable: ' . executable . ' is not an executable') return {} endif @@ -240,8 +250,8 @@ function! s:generate_cmd(definition, filetype) abort let filename = expand('%:t') - let tmp_dir = has('win32') ? expand('$TEMP/neoformat') : - \ exists('$TMPDIR') ? expand('$TMPDIR/neoformat') : + let tmp_dir = has('win32') ? expand('$TEMP/neoformat', 1) : + \ exists('$TMPDIR') ? expand('$TMPDIR/neoformat', 1) : \ '/tmp/neoformat' if !isdirectory(tmp_dir) @@ -249,7 +259,7 @@ function! s:generate_cmd(definition, filetype) abort endif if get(a:definition, 'replace', 0) - let path = !using_stdin ? expand(tmp_dir . '/' . fnameescape(filename)) : '' + let path = !using_stdin ? expand(tmp_dir . '/' . fnameescape(filename), 1) : '' else let path = !using_stdin ? tempname() : '' endif diff --git a/bundle/neoformat/autoload/neoformat/formatters/beancount.vim b/bundle/neoformat/autoload/neoformat/formatters/beancount.vim new file mode 100644 index 000000000..f25161bb9 --- /dev/null +++ b/bundle/neoformat/autoload/neoformat/formatters/beancount.vim @@ -0,0 +1,10 @@ +function! neoformat#formatters#beancount#enabled() abort + return ['beanformat'] +endfunction + +function! neoformat#formatters#beancount#beanformat() abort + return { + \ 'exe': 'bean-format', + \ 'stdin': 1, + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/bib.vim b/bundle/neoformat/autoload/neoformat/formatters/bib.vim new file mode 100644 index 000000000..5ce4912ed --- /dev/null +++ b/bundle/neoformat/autoload/neoformat/formatters/bib.vim @@ -0,0 +1,10 @@ +function! neoformat#formatters#bib#enabled() abort + return ['bibclean'] +endfunction + +function! neoformat#formatters#bib#bibclean() abort + return { + \ 'exe': 'bibclean', + \ 'stdin': 1, + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/cabal.vim b/bundle/neoformat/autoload/neoformat/formatters/cabal.vim new file mode 100644 index 000000000..32c1b5a60 --- /dev/null +++ b/bundle/neoformat/autoload/neoformat/formatters/cabal.vim @@ -0,0 +1,10 @@ +function! neoformat#formatters#cabal#enabled() abort + return ['cabalfmt'] +endfunction + +function! neoformat#formatters#cabal#cabalfmt() abort + return { + \ 'exe' : 'cabal-fmt', + \ 'stdin' : 1, + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/cs.vim b/bundle/neoformat/autoload/neoformat/formatters/cs.vim index 7827a487a..c1b57f46a 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/cs.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/cs.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#cs#enabled() abort - return ['uncrustify', 'astyle'] + return ['uncrustify', 'astyle', 'clangformat'] endfunction function! neoformat#formatters#cs#uncrustify() abort @@ -17,3 +17,11 @@ function! neoformat#formatters#cs#astyle() abort \ 'stdin': 1, \ } endfunction + +function! neoformat#formatters#cs#clangformat() abort + return { + \ 'exe': 'clang-format', + \ 'args': ['-assume-filename=' . expand('%:t')], + \ 'stdin': 1, + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/css.vim b/bundle/neoformat/autoload/neoformat/formatters/css.vim index 0eb740bf6..00db92250 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/css.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/css.vim @@ -40,7 +40,7 @@ endfunction function! neoformat#formatters#css#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'css'], + \ 'args': ['--stdin-filepath', '"%:p"', '--parser', 'css'], \ 'stdin': 1 \ } endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/erlang.vim b/bundle/neoformat/autoload/neoformat/formatters/erlang.vim new file mode 100644 index 000000000..7384699d0 --- /dev/null +++ b/bundle/neoformat/autoload/neoformat/formatters/erlang.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#erlang#enabled() abort + return ['erlfmt'] +endfunction + +function! neoformat#formatters#erlang#erlfmt() abort + return { + \ 'exe': 'erlfmt', + \ 'args': ["-"], + \ 'stdin': 1 + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/fsharp.vim b/bundle/neoformat/autoload/neoformat/formatters/fsharp.vim new file mode 100644 index 000000000..99a4a70c1 --- /dev/null +++ b/bundle/neoformat/autoload/neoformat/formatters/fsharp.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#fsharp#enabled() abort + return ['fantomas'] +endfunction + +function! neoformat#formatters#fsharp#fantomas() abort + return { + \ 'exe': 'fantomas', + \ 'args': ['--stdin'], + \ 'stdin': 1 + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/gdscript.vim b/bundle/neoformat/autoload/neoformat/formatters/gdscript.vim new file mode 100644 index 000000000..7770fc2b8 --- /dev/null +++ b/bundle/neoformat/autoload/neoformat/formatters/gdscript.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#gdscript#enabled() abort + return ['gdformat'] +endfunction + +function! neoformat#formatters#gdscript#gdformat() abort + return { + \ 'exe': 'gdformat', + \ 'args': ['-'], + \ 'stdin': 1 + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/gleam.vim b/bundle/neoformat/autoload/neoformat/formatters/gleam.vim new file mode 100644 index 000000000..f26b1599d --- /dev/null +++ b/bundle/neoformat/autoload/neoformat/formatters/gleam.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#gleam#enabled() abort + return ['gleamformat'] +endfunction + +function! neoformat#formatters#gleam#gleamformat() abort + return { + \ 'exe': 'gleam', + \ 'args': ['format', '--stdin'], + \ 'stdin': 1, + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/go.vim b/bundle/neoformat/autoload/neoformat/formatters/go.vim index 33387ff38..ddd11ea3b 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/go.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/go.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#go#enabled() abort - return ['goimports', 'gofmt'] + return ['goimports', 'gofmt', 'gofumports', 'gofumpt'] endfunction function! neoformat#formatters#go#gofmt() abort @@ -16,3 +16,16 @@ function! neoformat#formatters#go#goimports() abort \ } endfunction +function! neoformat#formatters#go#gofumpt() abort + return { + \ 'exe': 'gofumpt', + \ 'stdin': 1, + \ } +endfunction + +function! neoformat#formatters#go#gofumports() abort + return { + \ 'exe': 'gofumports', + \ 'stdin': 1, + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/graphql.vim b/bundle/neoformat/autoload/neoformat/formatters/graphql.vim index 6f95d122b..b34e7f435 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/graphql.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/graphql.vim @@ -5,7 +5,7 @@ endfunction function! neoformat#formatters#graphql#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'graphql'], + \ 'args': ['--stdin-filepath', '"%:p"', '--parser', 'graphql'], \ 'stdin': 1 \ } endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/haskell.vim b/bundle/neoformat/autoload/neoformat/formatters/haskell.vim index 8c91a97f5..b0c83bd8c 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/haskell.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/haskell.vim @@ -55,7 +55,7 @@ function! neoformat#formatters#haskell#ormolu() abort endif return { \ 'exe' : 'ormolu', - \ 'args': ['-p', opts], + \ 'args': [opts], \ 'stdin' : 1, \ } endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/html.vim b/bundle/neoformat/autoload/neoformat/formatters/html.vim index 8f41ba17b..ec574f620 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/html.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/html.vim @@ -18,7 +18,7 @@ endfunction function! neoformat#formatters#html#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--stdin-filepath', '"%:p"'], + \ 'args': ['--stdin-filepath', '"%:p"'], \ 'stdin': 1, \ } endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/java.vim b/bundle/neoformat/autoload/neoformat/formatters/java.vim index 81aaa80ca..82f35ae12 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/java.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/java.vim @@ -31,7 +31,7 @@ endfunction function! neoformat#formatters#java#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--stdin-filepath', '"%:p"'], + \ 'args': ['--stdin-filepath', '"%:p"'], \ 'stdin': 1, \ } endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/javascript.vim b/bundle/neoformat/autoload/neoformat/formatters/javascript.vim index f4a741cff..6001694ce 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/javascript.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/javascript.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#javascript#enabled() abort - return ['jsbeautify', 'standard', 'prettier', 'prettydiff', 'clangformat', 'esformatter', 'prettiereslint', 'eslint_d'] + return ['jsbeautify', 'standard', 'semistandard', 'prettier', 'prettydiff', 'clangformat', 'esformatter', 'prettiereslint', 'eslint_d', 'denofmt'] endfunction function! neoformat#formatters#javascript#jsbeautify() abort @@ -40,7 +40,7 @@ endfunction function! neoformat#formatters#javascript#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--stdin-filepath', '"%:p"'], + \ 'args': ['--stdin-filepath', '"%:p"'], \ 'stdin': 1, \ } endfunction @@ -68,3 +68,19 @@ function! neoformat#formatters#javascript#standard() abort \ 'stdin': 1, \ } endfunction + +function! neoformat#formatters#javascript#denofmt() abort + return { + \ 'exe': 'deno', + \ 'args': ['fmt','-'], + \ 'stdin': 1, + \ } +endfunction + +function! neoformat#formatters#javascript#semistandard() abort + return { + \ 'exe': 'semistandard', + \ 'args': ['--stdin','--fix'], + \ 'stdin': 1, + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/javascriptreact.vim b/bundle/neoformat/autoload/neoformat/formatters/javascriptreact.vim new file mode 100644 index 000000000..ca41d5823 --- /dev/null +++ b/bundle/neoformat/autoload/neoformat/formatters/javascriptreact.vim @@ -0,0 +1,78 @@ +function! neoformat#formatters#javascriptreact#enabled() abort + return ['jsbeautify', 'standard', 'semistandard', 'prettier', 'prettydiff', 'esformatter', 'prettiereslint', 'eslint_d', 'denofmt'] +endfunction + +function! neoformat#formatters#javascriptreact#jsbeautify() abort + return { + \ 'exe': 'js-beautify', + \ 'args': ['--indent-size ' .shiftwidth()], + \ 'stdin': 1, + \ } +endfunction + +function! neoformat#formatters#javascriptreact#prettydiff() abort + return { + \ 'exe': 'prettydiff', + \ 'args': ['mode:"beautify"', + \ 'lang:"javascript"', + \ 'readmethod:"filescreen"', + \ 'endquietly:"quiet"', + \ 'source:"%:p"'], + \ 'no_append': 1 + \ } +endfunction + +function! neoformat#formatters#javascriptreact#esformatter() abort + return { + \ 'exe': 'esformatter', + \ 'stdin': 1, + \ } +endfunction + +function! neoformat#formatters#javascriptreact#prettier() abort + return { + \ 'exe': 'prettier', + \ 'args': ['--stdin-filepath', '"%:p"'], + \ 'stdin': 1, + \ } +endfunction + +function! neoformat#formatters#javascriptreact#prettiereslint() abort + return { + \ 'exe': 'prettier-eslint', + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"'], + \ 'stdin': 1, + \ } +endfunction + +function! neoformat#formatters#javascriptreact#eslint_d() abort + return { + \ 'exe': 'eslint_d', + \ 'args': ['--stdin', '--stdin-filename', '"%:p"', '--fix-to-stdout'], + \ 'stdin': 1, + \ } +endfunction + +function! neoformat#formatters#javascriptreact#standard() abort + return { + \ 'exe': 'standard', + \ 'args': ['--stdin','--fix'], + \ 'stdin': 1, + \ } +endfunction + +function! neoformat#formatters#javascriptreact#denofmt() abort + return { + \ 'exe': 'deno', + \ 'args': ['fmt','-'], + \ 'stdin': 1, + \ } +endfunction + +function! neoformat#formatters#javascriptreact#semistandard() abort + return { + \ 'exe': 'semistandard', + \ 'args': ['--stdin','--fix'], + \ 'stdin': 1, + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/json.vim b/bundle/neoformat/autoload/neoformat/formatters/json.vim index f11dc7fec..c4c82de3d 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/json.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/json.vim @@ -20,7 +20,7 @@ endfunction function! neoformat#formatters#json#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'json'], + \ 'args': ['--stdin-filepath', '"%:p"', '--parser', 'json'], \ 'stdin': 1, \ } endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/kotlin.vim b/bundle/neoformat/autoload/neoformat/formatters/kotlin.vim index f19b62cd4..139f472b2 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/kotlin.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/kotlin.vim @@ -13,7 +13,7 @@ endfunction function! neoformat#formatters#kotlin#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--stdin-filepath', '"%:p"'], + \ 'args': ['--stdin-filepath', '"%:p"'], \ 'stdin': 1, \ } endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/lua.vim b/bundle/neoformat/autoload/neoformat/formatters/lua.vim index 83a5dc399..2f777be36 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/lua.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/lua.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#lua#enabled() abort - return ['luaformatter', 'luafmt'] + return ['luaformatter', 'luafmt', 'luaformat'] endfunction function! neoformat#formatters#lua#luaformatter() abort @@ -15,3 +15,9 @@ function! neoformat#formatters#lua#luafmt() abort \ 'stdin': 1, \ } endfunction + +function! neoformat#formatters#lua#luaformat() abort + return { + \ 'exe': 'lua-format' + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/markdown.vim b/bundle/neoformat/autoload/neoformat/formatters/markdown.vim index 2003e0a4b..972903476 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/markdown.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/markdown.vim @@ -5,7 +5,7 @@ endfunction function! neoformat#formatters#markdown#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--stdin-filepath', '"%:p"'], + \ 'args': ['--stdin-filepath', '"%:p"'], \ 'stdin': 1, \ } endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/nginx.vim b/bundle/neoformat/autoload/neoformat/formatters/nginx.vim new file mode 100644 index 000000000..49d4108f9 --- /dev/null +++ b/bundle/neoformat/autoload/neoformat/formatters/nginx.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#nginx#enabled() abort + return ['nginxbeautifier'] +endfunction + +function! neoformat#formatters#nginx#nginxbeautifier() abort + return { + \ 'exe': 'nginxbeautifier', + \ 'args': ['-i'], + \ 'replace': 1, + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/nix.vim b/bundle/neoformat/autoload/neoformat/formatters/nix.vim index 86475edfa..80fb03532 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/nix.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/nix.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#nix#enabled() abort - return ['nixfmt'] + return ['nixfmt', 'nixpkgsfmt'] endfunction function! neoformat#formatters#nix#nixfmt() abort @@ -8,3 +8,10 @@ function! neoformat#formatters#nix#nixfmt() abort \ 'stdin': 1, \ } endfunction + +function! neoformat#formatters#nix#nixpkgsfmt() abort + return { + \ 'exe': 'nixpkgs-fmt', + \ 'stdin': 1, + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/php.vim b/bundle/neoformat/autoload/neoformat/formatters/php.vim index ea9d4851c..29f9af8c9 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/php.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/php.vim @@ -12,6 +12,7 @@ function! neoformat#formatters#php#phpcsfixer() abort return { \ 'exe': 'php-cs-fixer', \ 'args': ['fix', '-q'], + \ 'replace': 1, \ } endfunction @@ -19,6 +20,7 @@ function! neoformat#formatters#php#phpcbf() abort return { \ 'exe': 'phpcbf', \ 'stdin': 1, + \ 'args': ['-'], \ 'valid_exit_codes': [0,1], \ } endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/ps1.vim b/bundle/neoformat/autoload/neoformat/formatters/ps1.vim new file mode 100644 index 000000000..ebe206de2 --- /dev/null +++ b/bundle/neoformat/autoload/neoformat/formatters/ps1.vim @@ -0,0 +1,20 @@ +function! neoformat#formatters#ps1#enabled() abort + return ['PSScriptAnalyzer', 'PowerShellBeautifier'] +endfunction + +function! neoformat#formatters#ps1#PowerShellBeautifier() abort + return { + \ 'exe' : 'Edit-DTWBeautifyScript', + \ 'args' : ["-IndentType FourSpaces", "-StandardOutput"], + \ 'stdin' : 0, + \ } +endfunction + +function! neoformat#formatters#ps1#PSScriptAnalyzer() abort + return { + \ 'exe' : 'Invoke-Formatter', + \ 'args' : ['-ScriptDefinition (Get-Content ' . expand('%') . ' -Raw)'], + \ 'stdin' : 0, + \ 'no_append' : 1, + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/puppet.vim b/bundle/neoformat/autoload/neoformat/formatters/puppet.vim new file mode 100644 index 000000000..59d3de720 --- /dev/null +++ b/bundle/neoformat/autoload/neoformat/formatters/puppet.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#puppet#enabled() abort + return ['puppetlint'] +endfunction + +function! neoformat#formatters#puppet#puppetlint() abort + return { + \ 'exe': 'puppet-lint', + \ 'args': ['--fix'], + \ 'replace': 1, + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/python.vim b/bundle/neoformat/autoload/neoformat/formatters/python.vim index 6934954f5..a6b989503 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/python.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/python.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#python#enabled() abort - return ['yapf', 'autopep8', 'black', 'isort', 'docformatter', 'pyment', 'pydevf', 'autoflake'] + return ['yapf', 'autopep8', 'black', 'isort', 'docformatter', 'pyment', 'pydevf'] endfunction function! neoformat#formatters#python#yapf() abort @@ -35,14 +35,6 @@ function! neoformat#formatters#python#docformatter() abort \ } endfunction -function! neoformat#formatters#python#autoflake() abort - return { - \ 'exe': 'autoflake', - \ 'args': ['--remove-all-unused-imports', '--in-place', '--remove-duplicate-keys', '--expand-star-imports'], - \ 'stdin': 0, - \ } -endfunction - function! neoformat#formatters#python#black() abort return { \ 'exe': 'black', @@ -64,6 +56,5 @@ function! neoformat#formatters#python#pydevf() abort return { \ 'exe': 'pydevf', \ 'replace': 1, - \ 'args': ['-', '2>/dev/null'], \ } endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/r.vim b/bundle/neoformat/autoload/neoformat/formatters/r.vim index 45d767e97..1a708b797 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/r.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/r.vim @@ -5,8 +5,8 @@ endfunction function! neoformat#formatters#r#styler() abort return { \ 'exe': 'R', - \ 'args': ['--slave', '--no-restore', '--no-save', '-e "styler::style_text(readr::read_file((file(\"stdin\"))))"', '2>/dev/null'], - \ 'replace': 1, + \ 'args': ['--slave', '--no-restore', '--no-save', '-e "styler::style_text(readr::read_file(file(\"stdin\")))"', '2>/dev/null'], + \ 'stdin': 1, \} endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/reason.vim b/bundle/neoformat/autoload/neoformat/formatters/reason.vim index e6201adf6..01e0a5c51 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/reason.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/reason.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#reason#enabled() abort - return ['refmt'] + return ['refmt', 'bsrefmt'] endfunction function! neoformat#formatters#reason#refmt() abort @@ -9,3 +9,11 @@ function! neoformat#formatters#reason#refmt() abort \ 'args': ["--interface=" . (expand('%:e') == "rei" ? "true" : "false")], \ } endfunction + +function! neoformat#formatters#reason#bsrefmt() abort + return { + \ 'exe': 'bsrefmt', + \ 'stdin': 1, + \ 'args': ["--interface=" . (expand('%:e') == "rei" ? "true" : "false")], + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/rust.vim b/bundle/neoformat/autoload/neoformat/formatters/rust.vim index 762542319..b3ea14185 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/rust.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/rust.vim @@ -5,6 +5,10 @@ endfunction function! neoformat#formatters#rust#rustfmt() abort return { \ 'exe': 'rustfmt', + \ 'args': ['--config hard_tabs=' . (&expandtab ? 'false' : 'true') . + \ ',tab_spaces=' . shiftwidth() . + \ ',max_width=' . &textwidth + \ ], \ 'stdin': 1, \ } endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/svelte.vim b/bundle/neoformat/autoload/neoformat/formatters/svelte.vim index 5803ad500..b96eca79b 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/svelte.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/svelte.vim @@ -5,7 +5,7 @@ endfunction function! neoformat#formatters#svelte#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--stdin-filepath', '--parser=svelte', '--plugin-search-dir=.', '"%:p"'], + \ 'args': ['--stdin-filepath', '--parser=svelte', '--plugin-search-dir=.', '"%:p"'], \ 'stdin': 1, \ } endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/typescript.vim b/bundle/neoformat/autoload/neoformat/formatters/typescript.vim index 10556da57..7400e54c9 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/typescript.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/typescript.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#typescript#enabled() abort - return ['tsfmt', 'prettier', 'tslint', 'eslint_d', 'clangformat'] + return ['tsfmt', 'prettier', 'prettiereslint', 'tslint', 'eslint_d', 'clangformat', 'denofmt'] endfunction function! neoformat#formatters#typescript#tsfmt() abort @@ -13,11 +13,19 @@ endfunction function! neoformat#formatters#typescript#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'typescript'], + \ 'args': ['--stdin-filepath', '"%:p"', '--parser', 'typescript'], \ 'stdin': 1 \ } endfunction +function! neoformat#formatters#typescript#prettiereslint() abort + return { + \ 'exe': 'prettier-eslint', + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'typescript'], + \ 'stdin': 1, + \ } +endfunction + function! neoformat#formatters#typescript#tslint() abort let args = ['--fix', '--force'] @@ -47,3 +55,7 @@ function! neoformat#formatters#typescript#clangformat() abort \ 'stdin': 1 \ } endfunction + +function! neoformat#formatters#typescript#denofmt() abort + return neoformat#formatters#javascript#denofmt() +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/typescriptreact.vim b/bundle/neoformat/autoload/neoformat/formatters/typescriptreact.vim new file mode 100644 index 000000000..f61140e02 --- /dev/null +++ b/bundle/neoformat/autoload/neoformat/formatters/typescriptreact.vim @@ -0,0 +1,61 @@ +function! neoformat#formatters#typescriptreact#enabled() abort + return ['tsfmt', 'prettier', 'prettiereslint', 'tslint', 'eslint_d', 'clangformat', 'denofmt'] +endfunction + +function! neoformat#formatters#typescriptreact#tsfmt() abort + return { + \ 'exe': 'tsfmt', + \ 'args': ['--replace', '--baseDir=%:h'], + \ 'replace': 1 + \ } +endfunction + +function! neoformat#formatters#typescriptreact#prettier() abort + return { + \ 'exe': 'prettier', + \ 'args': ['--stdin-filepath', '"%:p"', '--parser', 'typescript'], + \ 'stdin': 1 + \ } +endfunction + +function! neoformat#formatters#typescriptreact#prettiereslint() abort + return { + \ 'exe': 'prettier-eslint', + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'typescript'], + \ 'stdin': 1, + \ } +endfunction + +function! neoformat#formatters#typescriptreact#tslint() abort + let args = ['--fix', '--force'] + + if filereadable('tslint.json') + let args = ['-c tslint.json'] + args + endif + + return { + \ 'exe': 'tslint', + \ 'args': args, + \ 'replace': 1 + \ } +endfunction + +function! neoformat#formatters#typescriptreact#eslint_d() abort + return { + \ 'exe': 'eslint_d', + \ 'args': ['--stdin', '--stdin-filename', '"%:p"', '--fix-to-stdout'], + \ 'stdin': 1, + \ } +endfunction + +function! neoformat#formatters#typescriptreact#clangformat() abort + return { + \ 'exe': 'clang-format', + \ 'args': ['-assume-filename=' . expand('%:t')], + \ 'stdin': 1 + \ } +endfunction + +function! neoformat#formatters#typescriptreact#denofmt() abort + return neoformat#formatters#javascript#denofmt() +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/v.vim b/bundle/neoformat/autoload/neoformat/formatters/v.vim new file mode 100644 index 000000000..f05f10059 --- /dev/null +++ b/bundle/neoformat/autoload/neoformat/formatters/v.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#v#enabled() abort + return ['vformat'] +endfunction + +function! neoformat#formatters#v#vformat() abort + return { + \ 'exe': 'v', + \ 'args': ['fmt', '-w'], + \ 'replace': 1 + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/vue.vim b/bundle/neoformat/autoload/neoformat/formatters/vue.vim index 4bec11247..7f863fff2 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/vue.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/vue.vim @@ -5,7 +5,7 @@ endfunction function! neoformat#formatters#vue#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'vue'], + \ 'args': ['--stdin-filepath', '"%:p"', '--parser', 'vue'], \ 'stdin': 1 \ } endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/xml.vim b/bundle/neoformat/autoload/neoformat/formatters/xml.vim index 13061cb5d..7fae25ced 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/xml.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/xml.vim @@ -23,7 +23,7 @@ endfunction function! neoformat#formatters#xml#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--stdin-filepath', '"%:p"'], + \ 'args': ['--stdin-filepath', '"%:p"'], \ 'stdin': 1, \ } endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/yaml.vim b/bundle/neoformat/autoload/neoformat/formatters/yaml.vim index 54a407f11..477a60e5c 100644 --- a/bundle/neoformat/autoload/neoformat/formatters/yaml.vim +++ b/bundle/neoformat/autoload/neoformat/formatters/yaml.vim @@ -13,7 +13,7 @@ endfunction function! neoformat#formatters#yaml#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'yaml'], + \ 'args': ['--stdin-filepath', '"%:p"', '--parser', 'yaml'], \ 'stdin': 1 \ } endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/zig.vim b/bundle/neoformat/autoload/neoformat/formatters/zig.vim new file mode 100644 index 000000000..1fecb05e8 --- /dev/null +++ b/bundle/neoformat/autoload/neoformat/formatters/zig.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#zig#enabled() abort + return ['zigfmt'] +endfunction + +function! neoformat#formatters#zig#zigfmt() abort +return { + \ 'exe': 'zig', + \ 'args': ['fmt'], + \ 'replace': 1 + \ } +endfunction diff --git a/bundle/neoformat/autoload/neoformat/formatters/zsh.vim b/bundle/neoformat/autoload/neoformat/formatters/zsh.vim new file mode 100644 index 000000000..fee0760ad --- /dev/null +++ b/bundle/neoformat/autoload/neoformat/formatters/zsh.vim @@ -0,0 +1,13 @@ +function! neoformat#formatters#zsh#enabled() abort + return ['shfmt'] +endfunction + +function! neoformat#formatters#zsh#shfmt() abort + let opts = get(g:, 'shfmt_opt', '') + + return { + \ 'exe': 'shfmt', + \ 'args': ['-i ' . shiftwidth(), opts], + \ 'stdin': 1, + \ } +endfunction diff --git a/bundle/neoformat/doc/neoformat.txt b/bundle/neoformat/doc/neoformat.txt index 5cb67cc4b..b71155522 100644 --- a/bundle/neoformat/doc/neoformat.txt +++ b/bundle/neoformat/doc/neoformat.txt @@ -178,6 +178,7 @@ See Config above for options return {'exe': {{ other formatter name }} endfunction < +3. Update `README.md` and `doc/neoformat.txt` ============================================================================== MANAGING UNDO HISTORY *neoformat-managing-undo-history* @@ -213,6 +214,10 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* - [`asmfmt`](https://github.com/klauspost/asmfmt) - Bazel - [`buildifier`](https://github.com/bazelbuild/buildtools/blob/master/buildifier/README.md) +- Beancount + - [`bean-format`](https://beancount.github.io/docs/running_beancount_and_generating_reports.html#bean-format) +- Bib + - [bibclean](https://github.com/tobywf/bibclean) - C - [`uncrustify`](http://uncrustify.sourceforge.net), [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html), @@ -220,10 +225,13 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* - C# - [`uncrustify`](http://uncrustify.sourceforge.net), [`astyle`](http://astyle.sourceforge.net) + [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html) - C++ - [`uncrustify`](http://uncrustify.sourceforge.net), [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html), [`astyle`](http://astyle.sourceforge.net) +- Cabal + - [`cabal-fmt`](https://github.com/phadej/cabal-fmt) - CMake - [`cmake_format`](https://github.com/cheshirekow/cmake_format) - Crystal @@ -250,24 +258,41 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* - [mix format](https://hexdocs.pm/mix/master/Mix.Tasks.Format.html) - Elm - [`elm-format`](https://github.com/avh4/elm-format) +- Erlang + - [`erlfmt`](https://github.com/WhatsApp/erlfmt) - Fish - [`fish_indent`](http://fishshell.com) +- F# + - [`fantomas`](https://github.com/fsprojects/fantomas) +- GDScript + - [`gdformat`](https://github.com/Scony/godot-gdscript-toolkit) +- Gleam + - [gleam format](https://github.com/gleam-lang/gleam/) - Go - [`gofmt`](https://golang.org/cmd/gofmt/), - [`goimports`](https://godoc.org/golang.org/x/tools/cmd/goimports) + [`goimports`](https://godoc.org/golang.org/x/tools/cmd/goimports), + [`gofumpt`](https://github.com/mvdan/gofumpt), + [`gofumports`](https://github.com/mvdan/gofumpt) - GLSL - [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html) - GraphQL - [`prettier`](https://github.com/prettier/prettier) - Haskell - - [`stylish-haskell`](https://github.com/jaspervdj/stylish-haskell) + - [`stylishhaskell`](https://github.com/jaspervdj/stylish-haskell) - [`hindent`](https://github.com/chrisdone/hindent) - [`hfmt`](https://github.com/danstiner/hfmt) - [`brittany`](https://github.com/lspitzner/brittany) - - [`sort-imports`](https://github.com/evanrelf/sort-imports) + - [`sortimports`](https://github.com/evanrelf/sort-imports) - [`floskell`](https://github.com/ennocramer/floskell) - [`ormolu`](https://github.com/tweag/ormolu) `let g:ormolu_ghc_opt=["TypeApplications", "RankNTypes"]` + - You must use formatter's name without "`-`" + " right + let g:neoformat_enabled_haskell = ['sortimports', 'stylishhaskell'] + " wrong + let g:neoformat_enabled_haskell = ['sort-imports', 'stylish-haskell'] +- Puppet + - [`puppet-lint`](https://github.com/rodjek/puppet-lint) - PureScript - [`purty`](https://gitlab.com/joneshf/purty) - HTML @@ -279,6 +304,7 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* - Java - [`uncrustify`](http://uncrustify.sourceforge.net), [`astyle`](http://astyle.sourceforge.net) + [`prettier`](https://github.com/prettier/prettier) - JavaScript - [`js-beautify`](https://github.com/beautify-web/js-beautify), [`prettier`](https://github.com/jlongster/prettier), @@ -286,7 +312,10 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html), [`esformatter`](https://github.com/millermedeiros/esformatter/), [`prettier-eslint`](https://github.com/kentcdodds/prettier-eslint-cli), - [`standard`](https://standardjs.com/) + [`eslint_d`](https://github.com/mantoni/eslint_d.js), + [`standard`](https://standardjs.com/), + [`semistandard`](https://github.com/standard/semistandard), + [`deno fmt`](https://deno.land/manual/tools/formatter), - JSON - [`js-beautify`](https://github.com/beautify-web/js-beautify), [`prettydiff`](https://github.com/prettydiff/prettydiff), @@ -295,6 +324,7 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* [`fixjson`](https://github.com/rhysd/fixjson) - Kotlin - [`ktlint`](https://github.com/shyiko/ktlint) + [`prettier`](https://github.com/prettier/prettier) - LaTeX - [`latexindent`](https://github.com/cmhughes/latexindent.pl) - Less @@ -304,15 +334,20 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* [`stylelint`](https://stylelint.io/) - Lua - [`luaformatter`](https://github.com/LuaDevelopmentTools/luaformatter) + - [`lua-fmt`](https://github.com/trixnz/lua-fmt) + - [`lua-format`](https://github.com/Koihik/LuaFormatter) - Markdown - [`remark`](https://github.com/wooorm/remark) [`prettier`](https://github.com/prettier/prettier), - Matlab - [`matlab-formatter-vscode`](https://github.com/affenwiesel/matlab-formatter-vscode) +- Nginx + - [nginxbeautifier](https://github.com/vasilevich/nginxbeautifier) - Nim - nimpretty (ships with [nim](https://nim-lang.org/)), - Nix - [`nixfmt`](https://github.com/serokell/nixfmt) + - [`nixpkgs-fmt`](https://github.com/nix-community/nixpkgs-fmt) - Objective-C - [`uncrustify`](http://uncrustify.sourceforge.net), [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html), @@ -330,6 +365,9 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* - [`php_beautifier`](http://pear.php.net/package/PHP_Beautifier) - [`php-cs-fixer`](http://cs.sensiolabs.org/) - [`phpcbf`](https://github.com/squizlabs/PHP_CodeSniffer) +- PowerShell + - [`PSScriptAnalyzer`](https://github.com/PowerShell/PSScriptAnalyzer), + [`PowerShell-Beautifier`](https://github.com/DTW-DanWard/PowerShell-Beautifier) - Proto - [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html) - Pug (formally Jade) @@ -337,13 +375,17 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* - Python - [`yapf`](https://github.com/google/yapf), [`autopep8`](https://github.com/hhatto/autopep8), + [`black`](https://github.com/psf/black), [`pydevf`](https://github.com/fabioz/PyDev.Formatter), + [`isort`](https://github.com/timothycrosley/isort), + [`docformatter`](https://github.com/myint/docformatter), [`pyment`](https://github.com/dadadel/pyment) - [autoflake](https://github.com/myint/autoflake) - R - [`styler`](https://github.com/r-lib/styler), [`formatR`](https://github.com/yihui/formatR) +- Reason - [`refmt`](https://github.com/facebook/reason) + - [`bsrefmt`](https://github.com/bucklescript/bucklescript) - Ruby - [`rufo`](https://github.com/asterite/rufo) - [`ruby-beautify`](https://github.com/erniebrodeur/ruby-beautify) @@ -383,9 +425,13 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* - TypeScript - [`tsfmt`](https://github.com/vvakame/typescript-formatter), [`prettier`](https://github.com/prettier/prettier), + [`prettier-eslint`](https://github.com/kentcdodds/prettier-eslint-cli), [`tslint`](https://palantir.github.io/tslint) [`eslint_d`](https://github.com/mantoni/eslint_d.js) [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html), + [`deno fmt`](https://deno.land/manual/tools/formatter) +- V + - `v fmt` (ships with [`v`](https://vlang.io)) - VALA - [`uncrustify`](http://uncrustify.sourceforge.net) - Vue @@ -396,9 +442,14 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* - XML - [`tidy`](http://www.html-tidy.org), [`prettydiff`](https://github.com/prettydiff/prettydiff) + [`prettier`](https://github.com/prettier/prettier) - YAML - [`pyaml`](https://pypi.python.org/pypi/pyaml), [`prettier`](https://github.com/prettier/prettier) +- zig + - [`zig fmt`](https://github.com/ziglang/zig) +- zsh + - [`shfmt`](https://github.com/mvdan/sh) ============================================================================== vim:tw=78:ts=8:ft=help:norl:noet:fen:noet: