> For the complete documentation index, see [llms.txt](https://alix-lahuec.gitbook.io/zotero-roam/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alix-lahuec.gitbook.io/zotero-roam/v0.6/customization/other/autocomplete.md).

# autocomplete

### Settings

| Name      | Default value       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| --------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `trigger` | `''` (empty string) | <p>The character(s) that should trigger the autocomplete menu,</p><p>If <code>trigger</code> is an empty string (default), autocomplete will be disabled.</p>                                                                                                                                                                                                                                                                                                             |
| `format`  | `"citekey"`         | <p>The format in which the item's citekey should be inserted.</p><p>Should be one of :</p><p><code>"citekey"</code> (default)</p><p><code>"citation"</code></p><p><code>"tag"</code></p><p><code>"pageref"</code></p><p><code>"popover"</code></p>                                                                                                                                                                                                                        |
| `display` | `"citekey"`         | <p>The text that will be displayed in the inline menu.</p><p>Should be either <code>"citekey"</code> (default) or <code>"zettlr"</code> (authors-year-title string)</p><p></p><p>Note : the query will be matched against what is displayed in the menu. This means that, with <code>display: "citekey"</code>, the query will be matched against the citekey ; with <code>display: "zettlr"</code>, the query will be matched against the authors-year-title string.</p> |

### How to enable autocomplete

The autocomplete feature is disabled by default, unless a trigger is defined by the user.

To setup autocomplete, define the `autocomplete` property **inside of your existing zoteroRoam\_settings object** :

```javascript
// Example : using the @ character as trigger, with 'citekey' as format & display

// DO NOT define the zoteroRoam_settings object again
// Instead, modify your existing zoteroRoam_settings object

zoteroRoam_settings = {
    dataRequests: {
        apikey: 'XXXXXXXXXXXXXXXX',
        dataURI: 'users/1234567/items',
        params: 'limit=100'
    },
    autocomplete: {
        trigger: '@', // Show autocomplete menu when typing @
        format: 'citekey', // Insert the item as @citekey
        display: 'citekey' // Show autocomplete menu items as citekeys
    }
}
```

### `display: "zettlr"`

![An example where display has been set to "zettlr"](/files/-MXXrpRC8prb4c53tLEj)
