Autocomplete
Configuration
Options of the completion menus.
comark({
completion: {
slash: true, // `/` at the start of a line opens the block menu
chain: true, // reopen the menu after a pick that has a next step
drill: true, // → drills in, ← goes back
info: 'auto', // the docs panel; false hides it
maxItems: 80, // rendered options
icons: true,
},
})
Where items come from
| Source | Option |
|---|---|
| Components, props, slots | components and plugin manifests (Components) |
| Frontmatter keys and values | frontmatterSchema (JSON Schema) |
data.*, meta.* bindings | data / dataSchema, meta / metaSchema (Bindings) |
| Pages and assets in links | links: an array of { url, title?, kind? } or a function of the typed text (may be async) |
| Fence languages | codeLanguages (CodeMirror LanguageDescriptions) and plugins |
| Anything else | a plugin with completions or snippets |
Other options
| Option | Default | |
|---|---|---|
plugins | [] | editor plugins; a later plugin replaces an earlier one with the same name |
registerDefaultPlugins | true | comark's defaults: alert, attributes, components, frontmatter, html, task-list |
lint | true | structural, manifest and binding diagnostics |
hover | true | docs on hover |
keymap | true | marks, headings, lists, tasks, the component closer on Enter |
theme | true | menu and syntax theme |