diff --git a/vim/bundle/neoformat/CONTRIBUTING.md b/vim/bundle/neoformat/CONTRIBUTING.md index 52837df..517213a 100644 --- a/vim/bundle/neoformat/CONTRIBUTING.md +++ b/vim/bundle/neoformat/CONTRIBUTING.md @@ -1,4 +1,4 @@ # contributing If you are looking to add or update a formatter, please be sure to update both -`docs/neoformat.txt` as well as `README.md`. Thanks! +[`doc/neoformat.txt`](./doc/neoformat.txt) as well as [`README.md`](./README.md). Thanks! diff --git a/vim/bundle/neoformat/README.md b/vim/bundle/neoformat/README.md index e2930d6..7140472 100644 --- a/vim/bundle/neoformat/README.md +++ b/vim/bundle/neoformat/README.md @@ -31,7 +31,7 @@ Or specify a certain formatter (must be defined for the current filetype) Or format a visual selection of code in a different filetype -__Note:__ you must use a ! and pass the filetype of the selection +**Note:** you must use a ! and pass the filetype of the selection ```viml :Neoformat! python @@ -82,6 +82,7 @@ Options: | `args` | list of arguments | \[] | optional | | `replace` | overwrite the file, instead of updating the buffer | 0 | optional | | `stdin` | send data to the stdin of the formatter | 0 | optional | +| `stderr` | capture stderr output from formatter | 0 | optional | | `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 | | `env` | list of environment variable definitions to be prepended to the formatter command | \[] | optional | | `valid_exit_codes` | list of valid exit codes for formatters who do not respect common unix practices | \[0] | optional | @@ -134,6 +135,14 @@ succeeds) let g:neoformat_run_all_formatters = 1 ``` +Above options can be activated or deactivated per buffer. For example: + +```viml + " runs all formatters for current buffer without tab to spaces conversion + let b:neoformat_run_all_formatters = 1 + let b:neoformat_basic_format_retab = 0 +``` + Have Neoformat only msg when there is an error ```viml @@ -205,6 +214,8 @@ that caused Neoformat to be invoked. - [`uncrustify`](http://uncrustify.sourceforge.net), [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html), [`astyle`](http://astyle.sourceforge.net) +- Assembly + - [`asmfmt`](https://github.com/klauspost/asmfmt) - Bazel - [`buildifier`](https://github.com/bazelbuild/buildtools/blob/master/buildifier/README.md) - C @@ -213,11 +224,14 @@ that caused Neoformat to be invoked. [`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 @@ -226,6 +240,7 @@ that caused Neoformat to be invoked. - `css-beautify` (ships with [`js-beautify`](https://github.com/beautify-web/js-beautify)), [`prettydiff`](https://github.com/prettydiff/prettydiff), [`stylefmt`](https://github.com/morishitter/stylefmt), + [`stylelint`](https://stylelint.io/), [`csscomb`](http://csscomb.com), [`prettier`](https://github.com/prettier/prettier) - CSV @@ -235,39 +250,60 @@ that caused Neoformat to be invoked. [`dfmt`](https://github.com/Hackerpilot/dfmt) - Dart - [`dartfmt`](https://www.dartlang.org/tools/) +- Dhall + - [`dhall format`](https://dhall-lang.org) +- dune + - [`dune format`](https://github.com/ocaml/dune) - Elixir - [`mix format`](https://hexdocs.pm/mix/master/Mix.Tasks.Format.html) - Elm - [`elm-format`](https://github.com/avh4/elm-format) - Fish - [`fish_indent`](http://fishshell.com) +- 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) +- 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) - - [`hindent`](https://github.com/chrisdone/hindent) - - [`hfmt`](https://github.com/danstiner/hfmt) - - [`brittany`](https://github.com/lspitzner/brittany) + - [`stylish-haskell`](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), + [`floskell`](https://github.com/ennocramer/floskell) + [`ormolu`](https://github.com/tweag/ormolu) + ```vim + let g:ormolu_ghc_opt=["TypeApplications", "RankNTypes"] + ``` +- Puppet + - [`puppet-lint`](https://github.com/rodjek/puppet-lint) +- PureScript + - [`purty`](https://gitlab.com/joneshf/purty) - HTML - `html-beautify` (ships with [`js-beautify`](https://github.com/beautify-web/js-beautify)), + [`prettier`](https://github.com/prettier/prettier), [`prettydiff`](https://github.com/prettydiff/prettydiff) - Jade - [`pug-beautifier`](https://github.com/vingorius/pug-beautifier) - Java - [`uncrustify`](http://uncrustify.sourceforge.net), - [`astyle`](http://astyle.sourceforge.net) -- Javascript + [`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/prettier/prettier), [`prettydiff`](https://github.com/prettydiff/prettydiff), [`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/), + [`deno fmt`](https://deno.land/manual/tools/formatter), - JSON - [`js-beautify`](https://github.com/beautify-web/js-beautify), [`prettydiff`](https://github.com/prettydiff/prettydiff), @@ -275,25 +311,36 @@ that caused Neoformat to be invoked. [`jq`](https://stedolan.github.io/jq/), [`fixjson`](https://github.com/rhysd/fixjson) - Kotlin - - [`ktlint`](https://github.com/shyiko/ktlint) + - [`ktlint`](https://github.com/shyiko/ktlint), + [`prettier`](https://github.com/prettier/prettier) - LaTeX - [`latexindent`](https://github.com/cmhughes/latexindent.pl) - Less - [`csscomb`](http://csscomb.com), [`prettydiff`](https://github.com/prettydiff/prettydiff), - [`prettier`](https://github.com/prettier/prettier) + [`prettier`](https://github.com/prettier/prettier), + [`stylelint`](https://stylelint.io/) - Lua - [`luaformatter`](https://github.com/LuaDevelopmentTools/luaformatter) + - [`lua-fmt`](https://github.com/trixnz/lua-fmt) - 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) - Objective-C - [`uncrustify`](http://uncrustify.sourceforge.net), [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html), [`astyle`](http://astyle.sourceforge.net) - OCaml - - [`ocp-indent`](http://www.typerex.org/ocp-indent.html) - - [`ocamlformat`](https://github.com/ocaml-ppx/ocamlformat) + - [`ocp-indent`](http://www.typerex.org/ocp-indent.html), + [`ocamlformat`](https://github.com/ocaml-ppx/ocamlformat) - Pandoc Markdown - [`pandoc`](https://pandoc.org/MANUAL.html) - Pawn @@ -301,8 +348,11 @@ that caused Neoformat to be invoked. - Perl - [`perltidy`](http://perltidy.sourceforge.net) - PHP - - [`php_beautifier`](http://pear.php.net/package/PHP_Beautifier) - - [`php-cs-fixer`](http://cs.sensiolabs.org/) + - [`php_beautifier`](http://pear.php.net/package/PHP_Beautifier), + [`php-cs-fixer`](http://cs.sensiolabs.org/), + [`phpcbf`](https://github.com/squizlabs/PHP_CodeSniffer) +- PowerShell + - [`PowerShell-Beautifier`](https://github.com/DTW-DanWard/PowerShell-Beautifier) - Proto - [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html) - Pug (formally Jade) @@ -310,38 +360,65 @@ 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) - - [`isort`](https://github.com/timothycrosley/isort) - - [`docformatter`](https://github.com/myint/docformatter) + [`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) +- 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), + [`ruby-beautify`](https://github.com/erniebrodeur/ruby-beautify), [`rubocop`](https://github.com/bbatsov/rubocop) - Rust - [`rustfmt`](https://github.com/rust-lang-nursery/rustfmt) - Sass - [`sass-convert`](http://sass-lang.com/documentation/#executables), + [`stylelint`](https://stylelint.io/), [`csscomb`](http://csscomb.com) +- Sbt + - [`scalafmt`](http://scalameta.org/scalafmt/) - Scala - [`scalariform`](https://github.com/scala-ide/scalariform), [`scalafmt`](http://scalameta.org/scalafmt/) - SCSS - [`sass-convert`](http://sass-lang.com/documentation/#executables), + [`stylelint`](https://stylelint.io/), [`stylefmt`](https://github.com/morishitter/stylefmt), [`prettydiff`](https://github.com/prettydiff/prettydiff), [`csscomb`](http://csscomb.com), [`prettier`](https://github.com/prettier/prettier) - Shell - [`shfmt`](https://github.com/mvdan/sh) + ```vim + let g:shfmt_opt="-ci" + ``` - SQL - - `sqlformat` (ships with [sqlparse](https://github.com/andialbrecht/sqlparse)) + - [`sqlfmt`](https://github.com/jackc/sqlfmt), + `sqlformat` (ships with [sqlparse](https://github.com/andialbrecht/sqlparse)), + `pg_format` (ships with [pgFormatter](https://github.com/darold/pgFormatter)) +- Starlark + - [`buildifier`](https://github.com/bazelbuild/buildtools/blob/master/buildifier/README.md) +- Svelte + - [`prettier-plugin-svelte`](https://github.com/UnwrittenFun/prettier-plugin-svelte) +- Swift + - [`Swiftformat`](https://github.com/nicklockwood/SwiftFormat) - Terraform - [`terraform`](https://www.terraform.io/docs/commands/fmt.html), -- Typescript +- TypeScript - [`tsfmt`](https://github.com/vvakame/typescript-formatter), - [`prettier`](https://github.com/prettier/prettier) + [`prettier`](https://github.com/prettier/prettier), + [`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 @@ -351,6 +428,8 @@ that caused Neoformat to be invoked. [`prettydiff`](https://github.com/prettydiff/prettydiff) - XML - [`tidy`](http://www.html-tidy.org), - [`prettydiff`](https://github.com/prettydiff/prettydiff) + [`prettydiff`](https://github.com/prettydiff/prettydiff), + [`prettier`](https://github.com/prettier/prettier) - YAML - - [`pyaml`](https://pypi.python.org/pypi/pyaml) + - [`pyaml`](https://pypi.python.org/pypi/pyaml), + [`prettier`](https://github.com/prettier/prettier) diff --git a/vim/bundle/neoformat/autoload/neoformat.vim b/vim/bundle/neoformat/autoload/neoformat.vim index 467fe24..7891c83 100644 --- a/vim/bundle/neoformat/autoload/neoformat.vim +++ b/vim/bundle/neoformat/autoload/neoformat.vim @@ -43,7 +43,7 @@ function! s:neoformat(bang, user_input, start_line, end_line) abort for formatter in formatters if &formatprg != '' && split(&formatprg)[0] ==# formatter - \ && get(g:, 'neoformat_try_formatprg', 0) + \ && neoformat#utils#var('neoformat_try_formatprg') call neoformat#utils#log('using formatprg') let fmt_prg_def = split(&formatprg) let definition = { @@ -102,6 +102,11 @@ function! s:neoformat(bang, user_input, start_line, end_line) abort call neoformat#utils#log(v:shell_error) let process_ran_succesfully = index(cmd.valid_exit_codes, v:shell_error) != -1 + + if cmd.stderr_log != '' + call neoformat#utils#log('stderr output redirected to file' . cmd.stderr_log) + call neoformat#utils#log_file_content(cmd.stderr_log) + endif if process_ran_succesfully " 1. append the lines that are before and after the formatterd content let lines_after = getbufline(bufnr('%'), a:end_line + 1, '$') @@ -120,7 +125,7 @@ function! s:neoformat(bang, user_input, start_line, end_line) abort let endmsg = 'no change necessary with ' . cmd.name endif - if !get(g:, 'neoformat_run_all_formatters', 0) + if !neoformat#utils#var('neoformat_run_all_formatters') return neoformat#utils#msg(endmsg) endif call neoformat#utils#log('running next formatter') @@ -141,7 +146,7 @@ function! s:neoformat(bang, user_input, start_line, end_line) abort endfunction function! s:get_enabled_formatters(filetype) abort - if &formatprg != '' && get(g:, 'neoformat_try_formatprg', 0) + if &formatprg != '' && neoformat#utils#var('neoformat_try_formatprg') call neoformat#utils#log('adding formatprg to enabled formatters') let format_prg_exe = [split(&formatprg)[0]] else @@ -229,6 +234,8 @@ function! s:generate_cmd(definition, filetype) abort let no_append = get(a:definition, 'no_append', 0) let using_stdin = get(a:definition, 'stdin', 0) + let using_stderr = get(a:definition, 'stderr', 0) + let stderr_log = '' let filename = expand('%:t') @@ -250,10 +257,25 @@ function! s:generate_cmd(definition, filetype) abort let _fullcmd = join(inline_environment, ' ') . ' ' . executable . ' ' . join(args_expanded) . ' ' . (no_append ? '' : path) " make sure there aren't any double spaces in the cmd let fullcmd = join(split(_fullcmd)) + if !using_stderr + if neoformat#utils#should_be_verbose() + let stderr_log = expand(tmp_dir . '/stderr.log') + let fullcmd = fullcmd . ' 2> ' . stderr_log + else + if (has('win32') || has('win64')) + let stderr_log = '' + let fullcmd = fullcmd . ' 2> ' . 'NUL' + else + let stderr_log = '' + let fullcmd = fullcmd . ' 2> ' . '/dev/null' + endif + endif + endif return { \ 'exe': fullcmd, \ 'stdin': using_stdin, + \ 'stderr_log': stderr_log, \ 'name': a:definition.exe, \ 'replace': get(a:definition, 'replace', 0), \ 'tmp_file_path': path, @@ -279,17 +301,17 @@ function! s:basic_format() abort let g:neoformat_basic_format_trim = 0 endif - if g:neoformat_basic_format_align + if neoformat#utils#var('neoformat_basic_format_align') call neoformat#utils#log('aligning with basic formatter') let v = winsaveview() silent! execute 'normal gg=G' call winrestview(v) endif - if g:neoformat_basic_format_retab + if neoformat#utils#var('neoformat_basic_format_retab') call neoformat#utils#log('converting tabs with basic formatter') retab endif - if g:neoformat_basic_format_trim + if neoformat#utils#var('neoformat_basic_format_trim') call neoformat#utils#log('trimming whitespace with basic formatter') " http://stackoverflow.com/q/356126 let search = @/ diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/asm.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/asm.vim new file mode 100644 index 0000000..f2d72c0 --- /dev/null +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/asm.vim @@ -0,0 +1,10 @@ +function! neoformat#formatters#asm#enabled() abort + return ['asmfmt', ] +endfunction + +function! neoformat#formatters#asm#asmfmt() abort + return { + \ 'exe': 'asmfmt', + \ 'stdin': 1 + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/c.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/c.vim index dd694d3..304907d 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/c.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/c.vim @@ -13,6 +13,7 @@ endfunction function! neoformat#formatters#c#clangformat() abort return { \ 'exe': 'clang-format', + \ 'args': ['-assume-filename=' . expand('%:t')], \ 'stdin': 1, \ } endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/cabal.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/cabal.vim new file mode 100644 index 0000000..32c1b5a --- /dev/null +++ b/vim/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/vim/bundle/neoformat/autoload/neoformat/formatters/cs.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/cs.vim index 7827a48..c1b57f4 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/cs.vim +++ b/vim/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/vim/bundle/neoformat/autoload/neoformat/formatters/css.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/css.vim index a563136..0eb740b 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/css.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/css.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#css#enabled() abort - return ['stylefmt', 'prettier', 'cssbeautify', 'prettydiff', 'csscomb'] + return ['stylelint', 'stylefmt', 'prettier', 'cssbeautify', 'prettydiff', 'csscomb'] endfunction function! neoformat#formatters#css#cssbeautify() abort @@ -40,7 +40,15 @@ endfunction function! neoformat#formatters#css#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--parser', 'css'], + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'css'], \ 'stdin': 1 \ } endfunction + +function! neoformat#formatters#css#stylelint() abort + return { + \ 'exe': 'stylelint', + \ 'args': ['--fix', '--stdin-filename', '"%:t"'], + \ 'stdin': 1, + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/dhall.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/dhall.vim new file mode 100644 index 0000000..d2023b4 --- /dev/null +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/dhall.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#dhall#enabled() abort + return ['dhall'] +endfunction + +function! neoformat#formatters#dhall#dhall() abort + return { + \ 'exe': 'dhall', + \ 'args': ['format'], + \ 'stdin': 1 + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/dune.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/dune.vim new file mode 100644 index 0000000..e720a8b --- /dev/null +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/dune.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#dune#enabled() abort + return ['dune'] +endfunction + +function! neoformat#formatters#dune#dune() abort + return { + \ 'exe': 'dune', + \ 'args': ['format'], + \ 'stdin': 1 + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/elm.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/elm.vim index f443595..730e6e6 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/elm.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/elm.vim @@ -5,7 +5,7 @@ endfunction function! neoformat#formatters#elm#elmformat() abort return { \ 'exe': 'elm-format', - \ 'args': ['--stdin'], + \ 'args': ['--stdin', '--elm-version=0.19'], \ 'stdin': 1, \ } endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/gleam.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/gleam.vim new file mode 100644 index 0000000..f26b159 --- /dev/null +++ b/vim/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/vim/bundle/neoformat/autoload/neoformat/formatters/glsl.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/glsl.vim new file mode 100644 index 0000000..83b1355 --- /dev/null +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/glsl.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#glsl#enabled() abort + return ['clangformat'] +endfunction + +function! neoformat#formatters#glsl#clangformat() abort + return { + \ 'exe': 'clang-format', + \ 'args': ['-assume-filename=' . expand('%:t')], + \ 'stdin': 1, + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/graphql.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/graphql.vim index 29dc9d7..6f95d12 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/graphql.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/graphql.vim @@ -5,7 +5,7 @@ endfunction function! neoformat#formatters#graphql#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--parser', 'graphql'], + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'graphql'], \ 'stdin': 1 \ } endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/haskell.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/haskell.vim index b0692ce..8c91a97 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/haskell.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/haskell.vim @@ -1,11 +1,11 @@ function! neoformat#formatters#haskell#enabled() abort - return ['hindent', 'stylishhaskell', 'hfmt', 'brittany'] + return ['hindent', 'stylishhaskell', 'hfmt', 'brittany', 'sortimports', 'floskell', 'ormolu'] endfunction function! neoformat#formatters#haskell#hindent() abort return { \ 'exe' : 'hindent', - \ 'args': ['--indent-size ' . shiftwidth(), '--line-length 80'], + \ 'args': ['--indent-size ' . shiftwidth()], \ 'stdin' : 1, \ } endfunction @@ -13,7 +13,6 @@ endfunction function! neoformat#formatters#haskell#stylishhaskell() abort return { \ 'exe': 'stylish-haskell', - \ 'args': ['2>/dev/null'], \ 'stdin': 1, \ } endfunction @@ -32,3 +31,31 @@ function! neoformat#formatters#haskell#brittany() abort \ 'stdin': 1, \ } endfunction + +function! neoformat#formatters#haskell#sortimports() abort + return { + \ 'exe': 'sort-imports', + \ 'stdin': 1, + \ } +endfunction + +function! neoformat#formatters#haskell#floskell() abort + return { + \ 'exe': 'floskell', + \ 'stdin': 1, + \ } +endfunction + +function! neoformat#formatters#haskell#ormolu() abort + let opts = get(g:, 'ormolu_ghc_opt', []) + if opts != [] + let opts = '-o' . join(opts, ' -o') + else + let opts = '' + endif + return { + \ 'exe' : 'ormolu', + \ 'args': ['-p', opts], + \ 'stdin' : 1, + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/html.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/html.vim index c14a68e..8f41ba1 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/html.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/html.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#html#enabled() abort - return ['htmlbeautify', 'tidy', 'prettydiff'] + return ['htmlbeautify', 'prettier', 'tidy', 'prettydiff'] endfunction function! neoformat#formatters#html#tidy() abort @@ -15,6 +15,14 @@ function! neoformat#formatters#html#tidy() abort \ } endfunction +function! neoformat#formatters#html#prettier() abort + return { + \ 'exe': 'prettier', + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"'], + \ 'stdin': 1, + \ } +endfunction + function! neoformat#formatters#html#htmlbeautify() abort return { \ 'exe': 'html-beautify', diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/java.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/java.vim index bf3f396..81aaa80 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/java.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/java.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#java#enabled() abort - return ['uncrustify', 'astyle', 'clang-format'] + return ['uncrustify', 'astyle', 'clangformat', 'prettier'] endfunction function! neoformat#formatters#java#uncrustify() abort @@ -23,8 +23,17 @@ endfunction function! neoformat#formatters#java#clangformat() abort return { \ 'exe': 'clang-format', + \ 'args': ['-assume-filename=' . expand('%:t')], \ 'stdin': 1, \ } endfunction +function! neoformat#formatters#java#prettier() abort + return { + \ 'exe': 'prettier', + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"'], + \ 'stdin': 1, + \ } +endfunction + diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/javascript.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/javascript.vim index bbcfa18..1e03bfe 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/javascript.vim +++ b/vim/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', 'prettier', 'prettydiff', 'clangformat', 'esformatter', 'prettiereslint', 'eslint_d', 'denofmt'] endfunction function! neoformat#formatters#javascript#jsbeautify() abort @@ -13,6 +13,7 @@ endfunction function! neoformat#formatters#javascript#clangformat() abort return { \ 'exe': 'clang-format', + \ 'args': ['-assume-filename=' . expand('%:t')], \ 'stdin': 1 \ } endfunction @@ -39,7 +40,7 @@ endfunction function! neoformat#formatters#javascript#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--stdin-filepath', '%:p'], + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"'], \ 'stdin': 1, \ } endfunction @@ -47,7 +48,7 @@ endfunction function! neoformat#formatters#javascript#prettiereslint() abort return { \ 'exe': 'prettier-eslint', - \ 'args': ['--stdin', '--stdin-filepath', '%:p'], + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"'], \ 'stdin': 1, \ } endfunction @@ -55,7 +56,7 @@ endfunction function! neoformat#formatters#javascript#eslint_d() abort return { \ 'exe': 'eslint_d', - \ 'args': ['--stdin','--fix-to-stdout'], + \ 'args': ['--stdin', '--stdin-filename', '"%:p"', '--fix-to-stdout'], \ 'stdin': 1, \ } endfunction @@ -67,3 +68,11 @@ function! neoformat#formatters#javascript#standard() abort \ 'stdin': 1, \ } endfunction + +function! neoformat#formatters#javascript#denofmt() abort + return { + \ 'exe': 'deno', + \ 'args': ['fmt','-'], + \ 'stdin': 1, + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/json.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/json.vim index 3c3511e..f11dc7f 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/json.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/json.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#json#enabled() abort - return ['jsbeautify', 'prettydiff', 'jq', 'prettier'] + return ['jsbeautify', 'prettydiff', 'prettier', 'jq', 'fixjson'] endfunction function! neoformat#formatters#json#jsbeautify() abort @@ -20,7 +20,7 @@ endfunction function! neoformat#formatters#json#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--parser', 'json'], + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'json'], \ 'stdin': 1, \ } endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/kotlin.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/kotlin.vim index c2fd000..f19b62c 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/kotlin.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/kotlin.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#kotlin#enabled() abort - return ['ktlint'] + return ['ktlint', 'prettier'] endfunction function! neoformat#formatters#kotlin#ktlint() abort @@ -9,3 +9,13 @@ function! neoformat#formatters#kotlin#ktlint() abort \ 'replace': 1, \ } endfunction + +function! neoformat#formatters#kotlin#prettier() abort + return { + \ 'exe': 'prettier', + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"'], + \ 'stdin': 1, + \ } +endfunction + + diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/less.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/less.vim index ad18447..cb4d6d3 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/less.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/less.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#less#enabled() abort - return ['prettier', 'csscomb', 'prettydiff'] + return ['stylelint', 'prettier', 'csscomb', 'prettydiff'] endfunction function! neoformat#formatters#less#csscomb() abort @@ -13,3 +13,7 @@ endfunction function! neoformat#formatters#less#prettier() abort return neoformat#formatters#css#prettier() endfunction + +function! neoformat#formatters#less#stylelint() abort + return neoformat#formatters#css#stylelint() +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/lua.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/lua.vim index 744bdcc..83a5dc3 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/lua.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/lua.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#lua#enabled() abort - return ['luaformatter'] + return ['luaformatter', 'luafmt'] endfunction function! neoformat#formatters#lua#luaformatter() abort @@ -7,3 +7,11 @@ function! neoformat#formatters#lua#luaformatter() abort \ 'exe': 'luaformatter' \ } endfunction + +function! neoformat#formatters#lua#luafmt() abort + return { + \ 'exe': 'luafmt', + \ 'args': ['--stdin'], + \ 'stdin': 1, + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/markdown.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/markdown.vim index dba0584..2003e0a 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/markdown.vim +++ b/vim/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', '--stdin-filepath', '"%:p"'], \ 'stdin': 1, \ } endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/matlab.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/matlab.vim new file mode 100644 index 0000000..9bc268c --- /dev/null +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/matlab.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#matlab#enabled() abort + return ['matlabformatter'] +endfunction + +function! neoformat#formatters#matlab#matlabformatter() abort + return { + \ 'exe': 'matlab_formatter.py', + \ 'stdin': 0 + \ } +endfunction + diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/nginx.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/nginx.vim new file mode 100644 index 0000000..49d4108 --- /dev/null +++ b/vim/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/vim/bundle/neoformat/autoload/neoformat/formatters/nim.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/nim.vim new file mode 100644 index 0000000..edaa6fa --- /dev/null +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/nim.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#nim#enabled() abort + return ['nimpretty'] +endfunction + +function! neoformat#formatters#nim#nimpretty() abort + return { + \ 'exe': 'nimpretty', + \ 'args': ['--backup:off'], + \ 'replace': 1, + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/nix.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/nix.vim new file mode 100644 index 0000000..86475ed --- /dev/null +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/nix.vim @@ -0,0 +1,10 @@ +function! neoformat#formatters#nix#enabled() abort + return ['nixfmt'] +endfunction + +function! neoformat#formatters#nix#nixfmt() abort + return { + \ 'exe': 'nixfmt', + \ 'stdin': 1, + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/ocaml.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/ocaml.vim index 34da781..1a5281a 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/ocaml.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/ocaml.vim @@ -11,6 +11,8 @@ endfunction function! neoformat#formatters#ocaml#ocamlformat() abort return { \ 'exe': 'ocamlformat', - \ 'args': ['--name', '%:p'] + \ 'no_append': 1, + \ 'stdin': 1, + \ 'args': ['--name', '"%:p"', '-'] \ } endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/pandoc.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/pandoc.vim index d27fa41..deab6b7 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/pandoc.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/pandoc.vim @@ -11,6 +11,7 @@ function! neoformat#formatters#pandoc#pandoc() abort \ '+mmd_link_attributes', \ '+tex_math_double_backslash', \ '+emoji', + \ '+task_lists', \ ] let l:target_flags = ['markdown', @@ -18,22 +19,22 @@ function! neoformat#formatters#pandoc#pandoc() abort \ '-native_spans', \ '-simple_tables', \ '-multiline_tables', + \ '-fenced_code_attributes', \ '+emoji', + \ '+task_lists', \ ] - " The sed is to make checkboxes not get escaped. return { \ 'exe': 'pandoc', - \ 'args': ['-f' , - \ join(l:input_flags,''), - \ '-t', - \ join(l:target_flags,''), - \ '-s', - \ '--wrap=auto', - \ '--atx-headers', - \ '|', - \ "sed -e 's/\\\\\\[/[/g'", "-e 's/\\\\\\]/]/g'",], + \ 'args': [ + \ '-f' , + \ join(l:input_flags, ''), + \ '-t', + \ join(l:target_flags, ''), + \ '-s', + \ '--wrap=auto', + \ '--atx-headers', + \], \ 'stdin': 1, \ } endfunction - diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/php.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/php.vim index 6451cfe..ea9d485 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/php.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/php.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#php#enabled() abort - return ['phpbeautifier', 'phpcsfixer'] + return ['phpbeautifier', 'phpcsfixer', 'phpcbf'] endfunction function! neoformat#formatters#php#phpbeautifier() abort @@ -12,6 +12,13 @@ function! neoformat#formatters#php#phpcsfixer() abort return { \ 'exe': 'php-cs-fixer', \ 'args': ['fix', '-q'], - \ 'replace': 1, + \ } +endfunction + +function! neoformat#formatters#php#phpcbf() abort + return { + \ 'exe': 'phpcbf', + \ 'stdin': 1, + \ 'valid_exit_codes': [0,1], \ } endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/powershell.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/powershell.vim new file mode 100644 index 0000000..c070578 --- /dev/null +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/powershell.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#powershell#enabled() abort + return ['PowerShellBeautifier'] +endfunction + +function! neoformat#formatters#powershell#PowerShellBeautifier() abort + return { + \ 'exe' : 'Edit-DTWBeautifyScript', + \ 'args' : ["-IndentType FourSpaces", "-StandardOutput"], + \ 'stdin' : 0, + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/puppet.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/puppet.vim new file mode 100644 index 0000000..59d3de7 --- /dev/null +++ b/vim/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/vim/bundle/neoformat/autoload/neoformat/formatters/purescript.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/purescript.vim new file mode 100644 index 0000000..1e02199 --- /dev/null +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/purescript.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#purescript#enabled() abort + return ['purty'] +endfunction + +function! neoformat#formatters#purescript#purty() abort + return { + \ 'exe': 'purty', + \ 'args': ['-'], + \ 'stdin': 1, + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/python.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/python.vim index 7d8cd1f..a6b9895 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/python.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/python.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#python#enabled() abort - return ['yapf', 'autopep8', 'black', 'isort', 'docformatter'] + return ['yapf', 'autopep8', 'black', 'isort', 'docformatter', 'pyment', 'pydevf'] endfunction function! neoformat#formatters#python#yapf() abort @@ -21,7 +21,7 @@ endfunction function! neoformat#formatters#python#isort() abort return { \ 'exe': 'isort', - \ 'args': ['-', '--quiet'], + \ 'args': ['-', '--quiet',], \ 'stdin': 1, \ } endfunction @@ -39,6 +39,22 @@ function! neoformat#formatters#python#black() abort return { \ 'exe': 'black', \ 'stdin': 1, - \ 'args': ['-', '2>/dev/null'], + \ 'args': ['-q', '-'], + \ } +endfunction + + +function! neoformat#formatters#python#pyment() abort + return { + \ 'exe': 'pyment', + \ 'stdin': 1, + \ 'args': ['-w', '-'], + \ } +endfunction + +function! neoformat#formatters#python#pydevf() abort + return { + \ 'exe': 'pydevf', + \ 'replace': 1, \ } endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/r.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/r.vim new file mode 100644 index 0000000..45d767e --- /dev/null +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/r.vim @@ -0,0 +1,19 @@ +function! neoformat#formatters#r#enabled() abort + return ['styler', 'formatR'] +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, + \} +endfunction + +function! neoformat#formatters#r#formatR() abort + return { + \ 'exe': 'R', + \ 'args': ['--slave', '--no-restore', '--no-save', '-e "formatR::tidy_source(\"stdin\", arrow=FALSE)"', '2>/dev/null'], + \ 'stdin': 1, + \} +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/reason.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/reason.vim index 24f0d0a..01e0a5c 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/reason.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/reason.vim @@ -1,10 +1,19 @@ function! neoformat#formatters#reason#enabled() abort - return ['refmt'] + return ['refmt', 'bsrefmt'] endfunction function! neoformat#formatters#reason#refmt() abort return { \ 'exe': 'refmt', \ 'stdin': 1, + \ '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/vim/bundle/neoformat/autoload/neoformat/formatters/ruby.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/ruby.vim index 86ed4f8..f3cc808 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/ruby.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/ruby.vim @@ -20,7 +20,8 @@ endfunction function! neoformat#formatters#ruby#rubocop() abort return { \ 'exe': 'rubocop', - \ 'args': ['--auto-correct', '--stdin', '%:p', '2>/dev/null', '|', 'sed "1,/^====================$/d"'], + \ 'args': ['--auto-correct', '--stdin', '"%:p"', '2>/dev/null', '|', 'sed "1,/^====================$/d"'], \ 'stdin': 1, + \ 'stderr': 1 \ } endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/sass.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/sass.vim index 4d4e915..3397282 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/sass.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/sass.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#sass#enabled() abort - return ['sassconvert', 'csscomb'] + return ['sassconvert', 'stylelint', 'csscomb'] endfunction function! neoformat#formatters#sass#sassconvert() abort @@ -14,3 +14,6 @@ function! neoformat#formatters#sass#csscomb() abort return neoformat#formatters#css#csscomb() endfunction +function! neoformat#formatters#sass#stylelint() abort + return neoformat#formatters#css#stylelint() +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/sbt.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/sbt.vim new file mode 100644 index 0000000..d7c34bd --- /dev/null +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/sbt.vim @@ -0,0 +1,14 @@ +function! neoformat#formatters#sbt#enabled() abort + return ['scalafmt'] +endfunction + +" To understand sbt files on stdin, scalafmt needs to assume any old filename +" that ends in .sbt. Using a dummy filename instead of the actual one is +" required to support buffers of sbt filetype without the extension. +function! neoformat#formatters#sbt#scalafmt() abort + return { + \ 'exe': 'scalafmt', + \ 'args': ['--stdin', '--assume-filename', 'foo.sbt'], + \ 'stdin': 1, + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/scss.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/scss.vim index 9a96334..201af29 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/scss.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/scss.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#scss#enabled() abort - return ['sassconvert', 'stylefmt', 'prettier', 'prettydiff', 'csscomb'] + return ['sassconvert', 'stylelint', 'stylefmt', 'prettier', 'prettydiff', 'csscomb'] endfunction function! neoformat#formatters#scss#sassconvert() abort @@ -25,3 +25,7 @@ endfunction function! neoformat#formatters#scss#prettier() abort return neoformat#formatters#css#prettier() endfunction + +function! neoformat#formatters#scss#stylelint() abort + return neoformat#formatters#css#stylelint() +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/sh.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/sh.vim index 6999613..08c9a21 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/sh.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/sh.vim @@ -3,9 +3,11 @@ function! neoformat#formatters#sh#enabled() abort endfunction function! neoformat#formatters#sh#shfmt() abort + let opts = get(g:, 'shfmt_opt', '') + return { \ 'exe': 'shfmt', - \ 'args': ['-i ' . shiftwidth()], + \ 'args': ['-i ' . shiftwidth(), opts], \ 'stdin': 1, \ } endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/sql.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/sql.vim index 4197764..2218f45 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/sql.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/sql.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#sql#enabled() abort - return ['sqlformat'] + return ['sqlformat', 'pg_format', 'sqlfmt'] endfunction function! neoformat#formatters#sql#sqlformat() abort @@ -9,3 +9,19 @@ function! neoformat#formatters#sql#sqlformat() abort \ 'stdin': 1, \ } endfunction + +function! neoformat#formatters#sql#pg_format() abort + return { + \ 'exe': 'pg_format', + \ 'args': ['-'], + \ 'stdin': 1, + \ } +endfunction + +function! neoformat#formatters#sql#sqlfmt() abort + return { + \ 'exe': 'sqlfmt', + \ 'args': [], + \ 'stdin': 1, + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/starlark.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/starlark.vim new file mode 100644 index 0000000..97b7e9c --- /dev/null +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/starlark.vim @@ -0,0 +1,10 @@ +function! neoformat#formatters#starlark#enabled() abort + return ['buildifier'] +endfunction + +function! neoformat#formatters#starlark#buildifier() abort + return { + \ 'exe': 'buildifier', + \ 'stdin': 1 + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/svelte.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/svelte.vim new file mode 100644 index 0000000..5803ad5 --- /dev/null +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/svelte.vim @@ -0,0 +1,11 @@ +function! neoformat#formatters#svelte#enabled() abort + return ['prettier'] +endfunction + +function! neoformat#formatters#svelte#prettier() abort + return { + \ 'exe': 'prettier', + \ 'args': ['--stdin', '--stdin-filepath', '--parser=svelte', '--plugin-search-dir=.', '"%:p"'], + \ 'stdin': 1, + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/swift.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/swift.vim new file mode 100644 index 0000000..e2a49f8 --- /dev/null +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/swift.vim @@ -0,0 +1,10 @@ +function! neoformat#formatters#swift#enabled() abort + return ['swiftformat'] +endfunction + +function! neoformat#formatters#swift#swiftformat() abort + return { + \ 'exe': 'swiftformat', + \ 'stdin': 1 + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/tex.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/tex.vim index 2422336..37e5a36 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/tex.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/tex.vim @@ -5,8 +5,7 @@ endfunction function! neoformat#formatters#tex#latexindent() abort return { \ 'exe': 'latexindent', - \ 'args': ['-l', '-w'], - \ 'stdin': 0, - \ 'replace': 1 + \ 'args': ['-sl', '-g /dev/stderr', '2>/dev/null'], + \ 'stdin': 1, \ } endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/typescript.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/typescript.vim index 87cbd84..3a92296 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/typescript.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/typescript.vim @@ -1,19 +1,53 @@ function! neoformat#formatters#typescript#enabled() abort - return ['tsfmt', 'prettier'] + return ['tsfmt', 'prettier', 'tslint', 'eslint_d', 'clangformat', 'denofmt'] endfunction function! neoformat#formatters#typescript#tsfmt() abort return { \ 'exe': 'tsfmt', - \ 'args': ['--stdin', '%:p'], - \ 'stdin': 1 + \ 'args': ['--replace', '--baseDir=%:h'], + \ 'replace': 1 \ } endfunction function! neoformat#formatters#typescript#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--parser', 'typescript'], + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'typescript'], \ 'stdin': 1 \ } endfunction + +function! neoformat#formatters#typescript#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#typescript#eslint_d() abort + return { + \ 'exe': 'eslint_d', + \ 'args': ['--stdin', '--stdin-filename', '"%:p"', '--fix-to-stdout'], + \ 'stdin': 1, + \ } +endfunction + +function! neoformat#formatters#typescript#clangformat() abort + return { + \ 'exe': 'clang-format', + \ 'args': ['-assume-filename=' . expand('%:t')], + \ 'stdin': 1 + \ } +endfunction + +function! neoformat#formatters#typescript#denofmt() abort + return neoformat#formatters#javascript#denofmt() +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/v.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/v.vim new file mode 100644 index 0000000..f05f100 --- /dev/null +++ b/vim/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/vim/bundle/neoformat/autoload/neoformat/formatters/vue.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/vue.vim index bdd47ef..4bec112 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/vue.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/vue.vim @@ -5,7 +5,7 @@ endfunction function! neoformat#formatters#vue#prettier() abort return { \ 'exe': 'prettier', - \ 'args': ['--stdin', '--parser', 'vue'], + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'vue'], \ 'stdin': 1 \ } endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/xml.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/xml.vim index 8ea018a..13061cb 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/xml.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/xml.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#xml#enabled() abort - return ['tidy', 'prettydiff'] + return ['tidy', 'prettydiff', 'prettier'] endfunction function! neoformat#formatters#xml#tidy() abort @@ -19,3 +19,13 @@ endfunction function! neoformat#formatters#xml#prettydiff() abort return neoformat#formatters#html#prettydiff() endfunction + +function! neoformat#formatters#xml#prettier() abort + return { + \ 'exe': 'prettier', + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"'], + \ 'stdin': 1, + \ } +endfunction + + diff --git a/vim/bundle/neoformat/autoload/neoformat/formatters/yaml.vim b/vim/bundle/neoformat/autoload/neoformat/formatters/yaml.vim index 617f902..54a407f 100644 --- a/vim/bundle/neoformat/autoload/neoformat/formatters/yaml.vim +++ b/vim/bundle/neoformat/autoload/neoformat/formatters/yaml.vim @@ -1,5 +1,5 @@ function! neoformat#formatters#yaml#enabled() abort - return ['pyaml'] + return ['pyaml', 'prettier'] endfunction function! neoformat#formatters#yaml#pyaml() abort @@ -10,3 +10,10 @@ function! neoformat#formatters#yaml#pyaml() abort \ } endfunction +function! neoformat#formatters#yaml#prettier() abort + return { + \ 'exe': 'prettier', + \ 'args': ['--stdin', '--stdin-filepath', '"%:p"', '--parser', 'yaml'], + \ 'stdin': 1 + \ } +endfunction diff --git a/vim/bundle/neoformat/autoload/neoformat/utils.vim b/vim/bundle/neoformat/autoload/neoformat/utils.vim index 416efa7..06fe933 100644 --- a/vim/bundle/neoformat/autoload/neoformat/utils.vim +++ b/vim/bundle/neoformat/autoload/neoformat/utils.vim @@ -1,12 +1,15 @@ function! neoformat#utils#log(msg) abort - if !exists('g:neoformat_verbose') - let g:neoformat_verbose = 0 - endif - if &verbose || g:neoformat_verbose + if neoformat#utils#should_be_verbose() return s:better_echo(a:msg) endif endfunction +function! neoformat#utils#log_file_content(path) abort + if neoformat#utils#should_be_verbose() + return s:better_echo(readfile(a:path)) + endif +endfunction + function! neoformat#utils#warn(msg) abort echohl WarningMsg | call s:better_echo(a:msg) | echohl NONE endfunction @@ -18,6 +21,13 @@ function! neoformat#utils#msg(msg) abort return s:better_echo(a:msg) endfunction +function! neoformat#utils#should_be_verbose() abort + if !exists('g:neoformat_verbose') + let g:neoformat_verbose = 0 + endif + return &verbose || g:neoformat_verbose +endfunction + function! s:better_echo(msg) abort if type(a:msg) != type('') echom 'Neoformat: ' . string(a:msg) @@ -25,3 +35,15 @@ function! s:better_echo(msg) abort echom 'Neoformat: ' . a:msg endif endfunction + +function! neoformat#utils#var(name) abort + return neoformat#utils#var_default(a:name, 0) +endfunction + +function! neoformat#utils#var_default(name, default) abort + if exists('b:' . a:name) + return get(b:, a:name) + endif + + return get(g:, a:name, a:default) +endfunction diff --git a/vim/bundle/neoformat/doc/neoformat.txt b/vim/bundle/neoformat/doc/neoformat.txt index d6587b5..9d6a309 100644 --- a/vim/bundle/neoformat/doc/neoformat.txt +++ b/vim/bundle/neoformat/doc/neoformat.txt @@ -89,6 +89,9 @@ Options: | `args` | list of arguments | default: [] | optional | `replace` | overwrite the file, instead of updating the buffer | default: 0 | optional | `stdin` | send data to the stdin of the formatter | default 0 | optional +| `stderr` | used to specify whether stderr output should be read along with + the stdin, otherwise redirects stderr to `stderr.log` file in neoformat's + temporary directory | default 0 | optional | `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 | default: 0 | optional @@ -117,13 +120,13 @@ Have Neoformat use &formatprg as a formatter < Enable basic formatting when a filetype is not found. Disabled by default. > - " Enable alignment + " Enable alignment globally let g:neoformat_basic_format_align = 1 - " Enable tab to spaces conversion + " Enable tab to spaces conversion globally let g:neoformat_basic_format_retab = 1 - " Enable trimmming of trailing whitespace + " Enable trimmming of trailing whitespace globally let g:neoformat_basic_format_trim = 1 Run all enabled formatters (by default Neoformat stops after the first @@ -131,6 +134,12 @@ formatter succeeds) let g:neoformat_run_all_formatters = 1 +Above options can be activated or deactivated per buffer. For example: + + " runs all formatters for current buffer without tab to spaces conversion + let b:neoformat_run_all_formatters = 1 + let b:neoformat_basic_format_retab = 0 + Have Neoformat only msg when there is an error > let g:neoformat_only_msg_on_error = 1 @@ -200,6 +209,8 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* - [`uncrustify`](http://uncrustify.sourceforge.net), [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html), [`astyle`](http://astyle.sourceforge.net) +- Assembly + - [`asmfmt`](https://github.com/klauspost/asmfmt) - Bazel - [`buildifier`](https://github.com/bazelbuild/buildtools/blob/master/buildifier/README.md) - C @@ -209,10 +220,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 @@ -222,6 +236,7 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* [`prettier`](https://github.com/prettier/prettier), [`prettydiff`](https://github.com/prettydiff/prettydiff), [`stylefmt`](https://github.com/morishitter/stylefmt), + [`stylelint`](https://stylelint.io/), [`csscomb`](http://csscomb.com) - CSV - [`prettydiff`](https://github.com/prettydiff/prettydiff) @@ -230,15 +245,23 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* [`dfmt`](https://github.com/Hackerpilot/dfmt) - Dart - [`dartfmt`](https://www.dartlang.org/tools/) +- Dhall + - [`dhall format`](https://dhall-lang.org) +- dune + - [`dune format`](https://github.com/ocaml/dune) - Elixir - [mix format](https://hexdocs.pm/mix/master/Mix.Tasks.Format.html) - Elm - [`elm-format`](https://github.com/avh4/elm-format) - Fish - [`fish_indent`](http://fishshell.com) +- 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) +- GLSL + - [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html) - GraphQL - [`prettier`](https://github.com/prettier/prettier) - Haskell @@ -246,22 +269,34 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* - [`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) + - [`floskell`](https://github.com/ennocramer/floskell) + - [`ormolu`](https://github.com/tweag/ormolu) + `let g:ormolu_ghc_opt=["TypeApplications", "RankNTypes"]` +- Puppet + - [`puppet-lint`](https://github.com/rodjek/puppet-lint) +- PureScript + - [`purty`](https://gitlab.com/joneshf/purty) - HTML - `html-beautify` (ships with [`js-beautify`](https://github.com/beautify-web/js-beautify)), + [`prettier`](https://github.com/jlongster/prettier), [`prettydiff`](https://github.com/prettydiff/prettydiff) - Jade - [`pug-beautifier`](https://github.com/vingorius/pug-beautifier) - Java - [`uncrustify`](http://uncrustify.sourceforge.net), [`astyle`](http://astyle.sourceforge.net) -- Javascript + [`prettier`](https://github.com/prettier/prettier) +- JavaScript - [`js-beautify`](https://github.com/beautify-web/js-beautify), [`prettier`](https://github.com/jlongster/prettier), [`prettydiff`](https://github.com/prettydiff/prettydiff), [`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/) + [`deno fmt`](https://deno.land/manual/tools/formatter), - JSON - [`js-beautify`](https://github.com/beautify-web/js-beautify), [`prettydiff`](https://github.com/prettydiff/prettydiff), @@ -270,17 +305,28 @@ 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 - [`csscomb`](http://csscomb.com), [`prettier`](https://github.com/prettier/prettier), - [`prettydiff`](https://github.com/prettydiff/prettydiff) + [`prettydiff`](https://github.com/prettydiff/prettydiff), + [`stylelint`](https://stylelint.io/) - Lua - [`luaformatter`](https://github.com/LuaDevelopmentTools/luaformatter) + - [`lua-fmt`](https://github.com/trixnz/lua-fmt) - 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) - Objective-C - [`uncrustify`](http://uncrustify.sourceforge.net), [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html), @@ -297,6 +343,9 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* - PHP - [`php_beautifier`](http://pear.php.net/package/PHP_Beautifier) - [`php-cs-fixer`](http://cs.sensiolabs.org/) + - [`phpcbf`](https://github.com/squizlabs/PHP_CodeSniffer) +- PowerShell + - [`PowerShell-Beautifier`](https://github.com/DTW-DanWard/PowerShell-Beautifier) - Proto - [`clang-format`](http://clang.llvm.org/docs/ClangFormat.html) - Pug (formally Jade) @@ -304,36 +353,62 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes* - Python - [`yapf`](https://github.com/google/yapf), [`autopep8`](https://github.com/hhatto/autopep8), - [`black`](https://github.com/ambv/black) - [isort](https://github.com/timothycrosley/isort) - [docformatter](https://github.com/myint/docformatter) + [`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) +- 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) + - [`rufo`](https://github.com/asterite/rufo) - [`ruby-beautify`](https://github.com/erniebrodeur/ruby-beautify) - [`rubocop`](https://github.com/bbatsov/rubocop) - Rust - [`rustfmt`](https://github.com/rust-lang-nursery/rustfmt) - Sass - [`sass-convert`](http://sass-lang.com/documentation/#executables), + [`stylelint`](https://stylelint.io/), [`csscomb`](http://csscomb.com) +- Sbt + - [`scalafmt`](http://scalameta.org/scalafmt/) - Scala - - [`scalariform`](https://github.com/scala-ide/scalariform) + - [`scalariform`](https://github.com/scala-ide/scalariform), + [`scalafmt`](http://scalameta.org/scalafmt/) - SCSS - [`sass-convert`](http://sass-lang.com/documentation/#executables), [`stylefmt`](https://github.com/morishitter/stylefmt), + [`stylelint`](https://stylelint.io/) [`prettier`](https://github.com/prettier/prettier), [`prettydiff`](https://github.com/prettydiff/prettydiff), [`csscomb`](http://csscomb.com) - Shell - [`shfmt`](https://github.com/mvdan/sh) - SQL - - `sqlformat` (ships with [sqlparse](https://github.com/andialbrecht/sqlparse)) + - [`sqlfmt`](https://github.com/jackc/sqlfmt) + - `sqlformat` (ships with [`sqlparse`](https://github.com/andialbrecht/sqlparse)) + - `pg_format` (ships with [`pgFormatter`](https://github.com/darold/pgFormatter)) +- Starlark + - [`buildifier`](https://github.com/bazelbuild/buildtools/blob/master/buildifier/README.md) +- Svelte + - [`prettier-plugin-svelte`](https://github.com/UnwrittenFun/prettier-plugin-svelte) +- Swift + - [`Swiftformat`](https://github.com/nicklockwood/SwiftFormat) - Terraform - [`terraform`](https://www.terraform.io/docs/commands/fmt.html) -- Typescript - - [`tsfmt`](https://github.com/vvakame/typescript-formatter) +- 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) + [`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 @@ -344,8 +419,10 @@ 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) + - [`pyaml`](https://pypi.python.org/pypi/pyaml), + [`prettier`](https://github.com/prettier/prettier) ============================================================================== vim:tw=78:ts=8:ft=help:norl:noet:fen:noet: