|
1 | | -*luasnip.txt* For NVIM v0.5.0 Last change: 2022 September 08 |
| 1 | +*luasnip.txt* For NVIM v0.5.0 Last change: 2022 September 13 |
2 | 2 |
|
3 | 3 | ============================================================================== |
4 | 4 | Table of Contents *luasnip-table-of-contents* |
@@ -168,6 +168,12 @@ entries: |
168 | 168 | Snippets with high priority will be matched to a trigger before those with a |
169 | 169 | lower one. |
170 | 170 | The priority for multiple snippets can also be set in `add_snippets`. |
| 171 | +- `snippetType`: string, should be either `snippet` or `autosnippet` (ATTENTION: |
| 172 | + singular form is used), decides whether this snippet has to be triggered by |
| 173 | + `ls.expand()` or whether is triggered automatically (don’t forget to set |
| 174 | + `ls.config.setup({ enable_autosnippets = true })` if you want to use this |
| 175 | + feature). If unset it depends on how the snippet is added of which type the |
| 176 | + snippet will be. |
171 | 177 |
|
172 | 178 |
|
173 | 179 | `s` can also be a single string, in which case it is used instead of `trig`, |
@@ -2215,13 +2221,14 @@ empty the snippets table and the caches of the lazy_load. |
2215 | 2221 | Makes `snippets` (list of snippets) available in `ft`. If `ft` is `nil`, |
2216 | 2222 | `snippets` should be a table containing lists of snippets, the keys are |
2217 | 2223 | corresponding filetypes. `opts` may contain the following keys: |
2218 | | - - `type`: type of `snippets`, `"snippets"` or `"autosnippets"`. |
2219 | | - - `key`: Key that identifies snippets added via this call. |
2220 | | - If `add_snippets` is called with a key that was already used, the snippets |
2221 | | - from that previous call will be removed. |
2222 | | - This can be used to reload snippets: pass an unique key to each |
2223 | | - `add_snippets` and just re-do the `add_snippets`-call when the snippets have |
2224 | | - changed. |
| 2224 | + - `type`: type of `snippets`, `"snippets"` or `"autosnippets"` (ATTENTION: plural |
| 2225 | + form used here). This serves as default value for the `snippetType` key of each |
| 2226 | + snippet added by this call see |luasnip-snippets|. |
| 2227 | + - `key`: Key that identifies snippets added via this call. If `add_snippets` is |
| 2228 | + called with a key that was already used, the snippets from that previous call |
| 2229 | + will be removed. This can be used to reload snippets: pass an unique key to |
| 2230 | + each `add_snippets` and just re-do the `add_snippets`-call when the snippets |
| 2231 | + have changed. |
2225 | 2232 | - `override_priority`: set priority for all snippets. |
2226 | 2233 | - `default_priority`: set priority only for snippets without snippet-priority. |
2227 | 2234 | - `clean_invalidated(opts: table or nil) -> bool`: clean invalidated snippets |
|
0 commit comments