1
1
[ ![ Travis Build Status] ( https://travis-ci.org/google/vim-codefmt.svg?branch=master )] ( https://travis-ci.org/google/vim-codefmt )
2
2
3
- codefmt is a utility for syntax-aware code formatting. It contains several
3
+ codefmt is a utility for syntax-aware code formatting. It contains several
4
4
built-in formatters, and allows new formatters to be registered by other
5
5
plugins.
6
6
7
7
# Supported File-types
8
8
9
- * [ Bazel] ( https://www.github.com/bazelbuild/bazel ) BUILD files (buildifier)
10
- * C, C++ (clang-format)
11
- * [ Clojure] ( https://clojure.org/ ) ([ zprint] ( https://github.com/kkinnear/zprint ) ,
12
- [ cljstyle] ( https://github.com/greglook/cljstyle ) )
13
- * CSS, Sass, SCSS, Less (js-beautify)
14
- * Dart (dartfmt)
15
- * Fish ([ fish_indent] ( https://fishshell.com/docs/current/commands.html#fish_indent ) )
16
- * Go (gofmt)
17
- * [ GN] ( https://www.chromium.org/developers/gn-build-configuration ) (gn)
18
- * HTML (js-beautify)
19
- * Java (google-java-format or clang-format)
20
- * JavaScript (clang-format or [ prettier] ( https://prettier.io ) )
21
- * JSON (js-beautify)
22
- * Kotlin ([ ktfmt] ( https://github.com/facebookincubator/ktfmt ) )
23
- * Proto (clang-format)
24
- * Python (Autopep8, Black, Isort or YAPF)
25
- * Rust ([ rustfmt] ( https://github.com/rust-lang/rustfmt ) )
26
- * TypeScript (clang-format)
27
- * Shell (shfmt)
28
- * [ Vue] ( http://vuejs.org ) (prettier)
29
- * Nix (nixpkgs-fmt)
9
+ - [ Bazel] ( https://www.github.com/bazelbuild/bazel ) BUILD files (buildifier)
10
+ - C, C++ (clang-format)
11
+ - [ Clojure] ( https://clojure.org/ ) ([ zprint] ( https://github.com/kkinnear/zprint ) ,
12
+ [ cljstyle] ( https://github.com/greglook/cljstyle ) )
13
+ - CSS, Sass, SCSS, Less (js-beautify)
14
+ - Dart (dartfmt)
15
+ - Fish ([ fish_indent] ( https://fishshell.com/docs/current/commands.html#fish_indent ) )
16
+ - Go (gofmt)
17
+ - [ GN] ( https://www.chromium.org/developers/gn-build-configuration ) (gn)
18
+ - HTML (js-beautify)
19
+ - Java (google-java-format or clang-format)
20
+ - JavaScript (clang-format or [ prettier] ( https://prettier.io ) )
21
+ - JSON (js-beautify)
22
+ - Kotlin ([ ktfmt] ( https://github.com/facebookincubator/ktfmt ) )
23
+ - Proto (clang-format)
24
+ - Python (Autopep8, Black, Isort or YAPF)
25
+ - Rust ([ rustfmt] ( https://github.com/rust-lang/rustfmt ) )
26
+ - TypeScript (clang-format)
27
+ - Shell (shfmt)
28
+ - [ Vue] ( http://vuejs.org ) (prettier)
29
+ - Nix (nixpkgs-fmt)
30
30
31
31
# Commands
32
32
@@ -121,21 +121,21 @@ Assume a filetype `myft` and a formatter called `MyFormatter`. Our detailed
121
121
guide to creating a formatter [ lives
122
122
here] ( https://github.com/google/vim-codefmt/wiki/Formatter-Integration-Guide ) .
123
123
124
- * Create an issue for your new formatter and discuss!
124
+ - Create an issue for your new formatter and discuss!
125
125
126
- * Create a new file in ` autoload/codefmt/myformatter.vim ` See
126
+ - Create a new file in ` autoload/codefmt/myformatter.vim ` See
127
127
`autoload/codefmt/buildifier.vim for an example. This is where all the
128
128
logic for formatting goes.
129
129
130
- * Register the formatter in
130
+ - Register the formatter in
131
131
[ plugin/register.vim] ( plugin/register.vim )
132
132
with:
133
133
134
134
``` vim
135
135
call s:registry.AddExtension(codefmt#myformatter#GetFormatter())
136
136
```
137
137
138
- * Create a flag in
138
+ - Create a flag in
139
139
[instant/flags.vim](instant/flags.vim)
140
140
141
141
```vim
@@ -144,7 +144,7 @@ here](https://github.com/google/vim-codefmt/wiki/Formatter-Integration-Guide).
144
144
call s:plugin.Flag('myformatter_executable', 'myformatter')
145
145
```
146
146
147
- * Update the README.md to mention your new filetype!
147
+ - Update the README.md to mention your new filetype!
148
148
149
149
That's it! Of course, the complicated step is in the details of
150
150
`myformatter.vim`.
0 commit comments