1212" See the License for the specific language governing permissions and
1313" limitations under the License.
1414
15+ " "
16+ " @section Formatters, formatters
17+ " This plugin has three built-in formatters: clang-format, gofmt, and autopep8.
18+ " More formatters can be registered by other plugins that integrate with
19+ " codefmt.
20+ "
21+ " @subsection Default formatters
22+ " Codefmt will automatically use a default formatter for certain filetypes if
23+ " none is explicitly supplied via an explicit arg to @command(FormatCode) or the
24+ " @setting(b:codefmt_formatter) variable. The default formatter may also depend
25+ " on what plugins are enabled or what other software is installed on your
26+ " system.
27+ "
28+ " The current list of defaults by filetype is:
29+ " * bzl (Bazel): buildifier
30+ " * c, cpp, proto, javascript, typescript: clang-format
31+ " * clojure: cljstyle, zprint
32+ " * dart: dartfmt
33+ " * fish: fish_indent
34+ " * gn: gn
35+ " * go: gofmt
36+ " * java: google-java-format
37+ " * javascript, json, html, css: js-beautify
38+ " * javascript, html, css, markdown: prettier
39+ " * lua: luaformatterfiveone
40+ " * nix: nixpkgs-fmt
41+ " * python: autopep8, black, yapf
42+ " * rust: rustfmt
43+ " * sh: shfmt
44+
45+
1546let [s: plugin , s: enter ] = maktaba#plugin#Enter (expand (' <sfile>:p' ))
1647if ! s: enter
1748 finish
@@ -23,21 +54,21 @@ call s:registry.SetValidator('codefmt#EnsureFormatter')
2354
2455" Formatters that are registered later are given more priority when deciding
2556" what the default formatter will be for a particular file type.
26- call s: registry .AddExtension (codefmt#prettier#GetFormatter ())
27- call s: registry .AddExtension (codefmt#rustfmt#GetFormatter ())
28- call s: registry .AddExtension (codefmt#jsbeautify#GetFormatter ())
57+ call s: registry .AddExtension (codefmt#buildifier#GetFormatter ())
2958call s: registry .AddExtension (codefmt#clangformat#GetFormatter ())
3059call s: registry .AddExtension (codefmt#cljstyle#GetFormatter ())
31- call s: registry .AddExtension (codefmt#gofmt #GetFormatter ())
60+ call s: registry .AddExtension (codefmt#zprint #GetFormatter ())
3261call s: registry .AddExtension (codefmt#dartfmt#GetFormatter ())
33- call s: registry .AddExtension (codefmt#black#GetFormatter ())
34- call s: registry .AddExtension (codefmt#yapf#GetFormatter ())
35- call s: registry .AddExtension (codefmt#autopep8#GetFormatter ())
62+ call s: registry .AddExtension (codefmt#fish_indent#GetFormatter ())
3663call s: registry .AddExtension (codefmt#gn#GetFormatter ())
37- call s: registry .AddExtension (codefmt#buildifier #GetFormatter ())
64+ call s: registry .AddExtension (codefmt#gofmt #GetFormatter ())
3865call s: registry .AddExtension (codefmt#googlejava#GetFormatter ())
39- call s: registry .AddExtension (codefmt#shfmt#GetFormatter ())
40- call s: registry .AddExtension (codefmt#zprint#GetFormatter ())
41- call s: registry .AddExtension (codefmt#fish_indent#GetFormatter ())
42- call s: registry .AddExtension (codefmt#nixpkgs_fmt#GetFormatter ())
66+ call s: registry .AddExtension (codefmt#jsbeautify#GetFormatter ())
67+ call s: registry .AddExtension (codefmt#prettier#GetFormatter ())
4368call s: registry .AddExtension (codefmt#luaformatterfiveone#GetFormatter ())
69+ call s: registry .AddExtension (codefmt#nixpkgs_fmt#GetFormatter ())
70+ call s: registry .AddExtension (codefmt#autopep8#GetFormatter ())
71+ call s: registry .AddExtension (codefmt#black#GetFormatter ())
72+ call s: registry .AddExtension (codefmt#yapf#GetFormatter ())
73+ call s: registry .AddExtension (codefmt#rustfmt#GetFormatter ())
74+ call s: registry .AddExtension (codefmt#shfmt#GetFormatter ())
0 commit comments