mirror of
https://github.com/L3MON4D3/LuaSnip
synced 2024-09-16 21:54:03 +02:00
Auto generate docs
This commit is contained in:
parent
838b2668c5
commit
8ffedac33f
1 changed files with 37 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
|||
*luasnip.txt* For NVIM v0.8.0 Last change: 2024 August 06
|
||||
*luasnip.txt* For NVIM v0.8.0 Last change: 2024 August 20
|
||||
|
||||
==============================================================================
|
||||
Table of Contents *luasnip-table-of-contents*
|
||||
|
@ -60,10 +60,11 @@ Table of Contents *luasnip-table-of-contents*
|
|||
26. Cleanup |luasnip-cleanup|
|
||||
27. Logging |luasnip-logging|
|
||||
28. Source |luasnip-source|
|
||||
29. Config-Options |luasnip-config-options|
|
||||
30. Troubleshooting |luasnip-troubleshooting|
|
||||
29. Selection |luasnip-selection|
|
||||
30. Config-Options |luasnip-config-options|
|
||||
31. Troubleshooting |luasnip-troubleshooting|
|
||||
- Adding Snippets |luasnip-troubleshooting-adding-snippets|
|
||||
31. API |luasnip-api|
|
||||
32. API |luasnip-api|
|
||||
>
|
||||
__ ____
|
||||
/\ \ /\ _`\ __
|
||||
|
@ -3366,7 +3367,33 @@ It is also possible to get/set the source of a snippet via API:
|
|||
|
||||
|
||||
==============================================================================
|
||||
29. Config-Options *luasnip-config-options*
|
||||
29. Selection *luasnip-selection*
|
||||
|
||||
Many snippets use the `$TM_SELECTED_TEXT` or (for LuaSnip, preferably
|
||||
`LS_SELECT_RAW` or `LS_SELECT_DEDENT`) variable, which has to be populated by
|
||||
selecting and then yanking (and usually also cutting) text from the buffer
|
||||
before expanding.
|
||||
|
||||
By default, this is disabled (as to not pollute keybindings which may be used
|
||||
for something else), so one has to * either set `cut_selection_keys` in `setup`
|
||||
(see |luasnip-config-options|). * or map `ls.cut_keys` as the rhs of a mapping
|
||||
* or manually configure the keybinding. For this, create a new keybinding that
|
||||
1. `<Esc>`es to NORMAL (to populate the `<` and `>`-markers) 2. calls
|
||||
`luasnip.pre_yank(<namedreg>)` 3. yanks text to some named register
|
||||
`<namedreg>` 4. calls `luasnip.post_yank(<namedreg>)` Take care that the
|
||||
yanking actually takes place between the two calls. One way to ensure this is
|
||||
to call the two functions via `<cmd>lua ...<Cr>`: `lua vim.keymap.set("v",
|
||||
"<Tab>", [[<Esc><cmd>lua
|
||||
require("luasnip.util.select").pre_yank("z")<Cr>gv"zs<cmd>lua
|
||||
require('luasnip.util.select').post_yank("z")<Cr>]])` The reason for this
|
||||
specific order is to allow us to take a snapshot of registers (in the
|
||||
pre-callback), and then restore them (in the post-callback) (so that we may get
|
||||
the visual selection directly from the register, which seems to be the most
|
||||
foolproof way of doing this).
|
||||
|
||||
|
||||
==============================================================================
|
||||
30. Config-Options *luasnip-config-options*
|
||||
|
||||
These are the settings you can provide to `luasnip.setup()`:
|
||||
|
||||
|
@ -3401,9 +3428,9 @@ These are the settings you can provide to `luasnip.setup()`:
|
|||
so, remove it from the history. Off by default, `'TextChanged'` (perhaps
|
||||
`'InsertLeave'`, to react to changes done in Insert mode) should work just fine
|
||||
(alternatively, this can also be mapped using `<Plug>luasnip-delete-check`).
|
||||
- `store_selection_keys`: Mapping for populating `TM_SELECTED_TEXT` and related
|
||||
variables (not set by default). If you want to set this mapping yourself, map
|
||||
`ls.select_keys` (not a function, actually a string/key-combination) as a rhs.
|
||||
- `cut_selection_keys`: Mapping for populating `TM_SELECTED_TEXT` and related
|
||||
variables (not set by default). See |luasnip-selection| for more infos.
|
||||
- `store_selection_keys` (deprecated): same as `cut_selection_keys`
|
||||
- `enable_autosnippets`: Autosnippets are disabled by default to minimize
|
||||
performance penalty if unused. Set to `true` to enable.
|
||||
- `ext_opts`: Additional options passed to extmarks. Can be used to add
|
||||
|
@ -3451,7 +3478,7 @@ These are the settings you can provide to `luasnip.setup()`:
|
|||
|
||||
|
||||
==============================================================================
|
||||
30. Troubleshooting *luasnip-troubleshooting*
|
||||
31. Troubleshooting *luasnip-troubleshooting*
|
||||
|
||||
|
||||
ADDING SNIPPETS *luasnip-troubleshooting-adding-snippets*
|
||||
|
@ -3520,7 +3547,7 @@ GENERAL ~
|
|||
|
||||
|
||||
==============================================================================
|
||||
31. API *luasnip-api*
|
||||
32. API *luasnip-api*
|
||||
|
||||
`require("luasnip")`:
|
||||
|
||||
|
|
Loading…
Reference in a new issue