1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
# coc-html
Html language server extension for [coc.nvim](https://github.com/neoclide/coc.nvim).
Code changed from html extension of [VSCode](https://github.com/Microsoft/vscode/tree/master/extensions/html-language-features)
## Supporting
If you like this extension, consider supporting me on Patreon or PayPal:
<a href="https://www.patreon.com/chemzqm"><img src="https://c5.patreon.com/external/logo/become_a_patron_button.png" alt="Patreon donate button" /> </a>
<a href="https://www.paypal.com/paypalme/chezqm"><img src="https://werwolv.net/assets/paypal_banner.png" alt="PayPal donate button" /> </a>
## Install
In your vim/neovim, run command:
```
:CocInstall coc-html
```
## Features
- Completion provider
- Formatting
- Document Symbols & Highlights
- Document Links
- CSS mode
- Javascript mode
## Configuration options
- **html.enable**:
default: `true`
- **html.execArgv**:
default: `[]`
- **html.filetypes**:
default: `["html","handlebars","htmldjango","blade"]`
- **html.customData**:
A list of relative file paths pointing to JSON files following the [custom data format](https://github.com/microsoft/vscode-html-languageservice/blob/master/docs/customData.md).\n\ncoc-html loads custom data on startup to enhance its HTML support for the custom HTML tags, attributes and attribute values you specify in the JSON files.\n\nThe file paths are relative to workspace and only workspace folder settings are considered.
default: `[]`
- **html.completion.attributeDefaultValue**:
Controls the default value for attributes when completion is accepted, default: `"doublequotes"`
Valid options: ["doublequotes", "singlequotes", "empty"]
- **html.format.enable**:
Enable/disable default HTML formatter, default: `true`
- **html.format.wrapLineLength**:
Maximum amount of characters per line (0 = disable)., default: `120`
- **html.format.unformatted**:
List of tags, comma separated, that shouldn't be reformatted. 'null' defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content., default: `"wbr"`
- **html.format.contentUnformatted**:
List of tags, comma separated, where the content shouldn't be reformatted. 'null' defaults to the 'pre' tag., default: `"pre,code,textarea"`
- **html.format.indentInnerHtml**:
Indent `<head>` and `<body>` sections, default: `false`
- **html.format.preserveNewLines**:
Controls whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text, default: `true`
- **html.format.maxPreserveNewLines**:
List of tags, comma separated, that should have an extra newline before them. 'null', default: `null`
- **html.format.indentHandlebars**:
Format and indent `{{#foo}}` and `{{/foo}}`, default: `false`
- **html.format.endWithNewline**:
End with a newline, default: `false`
- **html.format.extraLiners**:
List of tags, comma separated, that should have an extra newline before them. `null` defaults to `\"head, body, /html\"`, default: `"head, body, /html"`
- **html.format.wrapAttributes**:
Wrap attributes, default: `"auto"`
Valid options: ["auto", "force", "force-aligned", "force-expand-multiline", "aligned-multiple", "preserve", "preserve-aligned"]
- **html.format.wrapAttributesIndentSize**:
Alignment size when using 'force aligned' and 'aligned multiple' in `#html.format.wrapAttributes#` or `null` to use the default indent size, default: `null`
- **html.format.templating**:
Honor django, erb, handlebars and php templating language tags, default: `false`
- **html.format.unformattedContentDelimiter**:
Keep text content together between this string, default: `""`
- **html.suggest.html5**:
Configures if the built-in HTML language support suggests HTML5 tags, properties and values., default: `true`
- **html.validate.scripts**:
Configures if the built-in HTML language support validates embedded scripts., default: `true`
- **html.validate.styles**:
Configures if the built-in HTML language support validates embedded styles., default: `true`
- **html.validate.html**:
Configures if the built-in HTML language support validates HTML., default: `true`
- **html.autoClosingTags**:
Enable/disable autoClosing of HTML tags, default: `true`
- **html.autoCreateQuotes**:
Enable/disable auto creation of quotes for HTML attribute assignment, default:
`true`
- **html.hover.documentation**:
Show tag and attribute documentation in hover, default: `true`
- **html.hover.references**:
Show references to MDN in hover, default: `true`
- **html.trace.server**:
Traces the communication between coc.nvim and the HTML language server, default: `"off"`
Valid options: ["off","messages","verbose"]
Trigger completion in `coc-settings.json` for complete list.
## F.A.Q
Q: I can't select the complete item by `<C-n>` and `<C-p>`
A: Some completion item requires insert position after current cursor position
which is invalid for `<C-n>` and `<C-p>` on vim, you can use `<up>` and `<down>`
key for selection, or use api `coc#_select_confirm()` to select and confirm
selection which is recommended.
## License
MIT
|