Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit b1b5109

Browse files
committed
vimdoc: Fill in formatters list with several that never got documented
Moves doc comments for formatters @section into plugin/register.vim alongside the relevant code that registers each formatter and fills out the list with several that had been implemented but never got documented.
1 parent df39259 commit b1b5109

File tree

3 files changed

+50
-37
lines changed

3 files changed

+50
-37
lines changed

autoload/codefmt.vim

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,6 @@
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: zprint
32-
" * dart: dartfmt
33-
" * fish: fish_indent
34-
" * gn: gn
35-
" * go: gofmt
36-
" * lua: luaformatterfiveone
37-
" * python: autopep8, black, yapf
38-
3915

4016
let s:plugin = maktaba#plugin#Get('codefmt')
4117
let s:registry = s:plugin.GetExtensionRegistry()

doc/codefmt.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,19 @@ plugins are enabled or what other software is installed on your system.
175175
The current list of defaults by filetype is:
176176
* bzl (Bazel): buildifier
177177
* c, cpp, proto, javascript, typescript: clang-format
178-
* clojure: zprint
178+
* clojure: cljstyle, zprint
179179
* dart: dartfmt
180180
* fish: fish_indent
181181
* gn: gn
182182
* go: gofmt
183+
* java: google-java-format
184+
* javascript, json, html, css: js-beautify
185+
* javascript, html, css, markdown: prettier
183186
* lua: luaformatterfiveone
187+
* nix: nixpkgs-fmt
184188
* python: autopep8, black, yapf
189+
* rust: rustfmt
190+
* sh: shfmt
185191

186192
==============================================================================
187193
DICTIONARIES *codefmt-dicts*

plugin/register.vim

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,37 @@
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+
1546
let [s:plugin, s:enter] = maktaba#plugin#Enter(expand('<sfile>:p'))
1647
if !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())
2958
call s:registry.AddExtension(codefmt#clangformat#GetFormatter())
3059
call s:registry.AddExtension(codefmt#cljstyle#GetFormatter())
31-
call s:registry.AddExtension(codefmt#gofmt#GetFormatter())
60+
call s:registry.AddExtension(codefmt#zprint#GetFormatter())
3261
call 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())
3663
call s:registry.AddExtension(codefmt#gn#GetFormatter())
37-
call s:registry.AddExtension(codefmt#buildifier#GetFormatter())
64+
call s:registry.AddExtension(codefmt#gofmt#GetFormatter())
3865
call 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())
4368
call 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

Comments
 (0)