1

Update generated neovim config

This commit is contained in:
2024-09-22 20:41:25 +02:00
parent 1743764e48
commit aa1271c42c
1247 changed files with 26512 additions and 15067 deletions

View File

@ -1,4 +1,4 @@
*luasnip.txt* For NVIM v0.8.0 Last change: 2024 August 01
*luasnip.txt* For NVIM v0.8.0 Last change: 2024 August 28
==============================================================================
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|
>
__ ____
/\ \ /\ _`\ __
@ -3259,6 +3260,8 @@ The node and `event_args` can be accessed through `require("luasnip").session`:
`event_args`:
- `expand_pos`: `{<row>, <column>}`, position at which the snippet will be
expanded. `<row>` and `<column>` are both 0-indexed.
- `expand_pos_mark_id`: `number`, the id of the extmark luasnip uses to track
`expand_pos`. This may be moved around freely.
`event_res`:
- `env_override`: `map string->(string[]|string)`, override or extend the
snippets environment (`snip.env`).
@ -3364,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()`:
@ -3399,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
@ -3449,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*
@ -3518,7 +3547,7 @@ GENERAL ~
==============================================================================
31. API *luasnip-api*
32. API *luasnip-api*
`require("luasnip")`:

View File

@ -48,6 +48,7 @@ luasnip-node luasnip.txt /*luasnip-node*
luasnip-node-api luasnip.txt /*luasnip-node-api*
luasnip-node-reference luasnip.txt /*luasnip-node-reference*
luasnip-restorenode luasnip.txt /*luasnip-restorenode*
luasnip-selection luasnip.txt /*luasnip-selection*
luasnip-snippetnode luasnip.txt /*luasnip-snippetnode*
luasnip-snippetproxy luasnip.txt /*luasnip-snippetproxy*
luasnip-snippets luasnip.txt /*luasnip-snippets*

View File

@ -65,6 +65,12 @@ c = {
conf.history = nil
end
if user_config.store_selection_keys ~= nil then
conf.cut_selection_keys = user_config.store_selection_keys
user_config.store_selection_keys = nil
end
for k, v in pairs(user_config) do
conf[k] = v
end
@ -125,12 +131,12 @@ c = {
end)
end
if session.config.store_selection_keys then
if session.config.cut_selection_keys then
vim.cmd(
string.format(
[[xnoremap <silent> %s %s]],
session.config.store_selection_keys,
require("luasnip.util.select").select_keys
session.config.cut_selection_keys,
require("luasnip.util.select").cut_keys
)
)
end

View File

@ -110,7 +110,10 @@ return {
-- see :h User, event should never be triggered(except if it is `doautocmd`'d)
region_check_events = nil,
delete_check_events = nil,
store_selection_keys = nil, -- Supossed to be the same as the expand shortcut
-- preserve default of store_selection_keys.
cut_selection_keys = nil,
ext_opts = {
[types.textNode] = {
active = { hl_group = "LuasnipTextNodeActive" },

View File

@ -844,7 +844,11 @@ local ls_lazy = {
config = function() return require("luasnip.config") end,
multi_snippet = function() return require("luasnip.nodes.multiSnippet").new_multisnippet end,
snippet_source = function() return require("luasnip.session.snippet_collection.source") end,
select_keys = function() return require("luasnip.util.select").select_keys end
cut_keys = function() return require("luasnip.util.select").cut_keys end,
-- keep select_keys for backwards-compatibility.
select_keys = function() return require("luasnip.util.select").cut_keys end,
pre_yank = function() return require("luasnip.util.select").pre_yank end,
post_yank = function() return require("luasnip.util.select").post_yank end,
}
ls = lazy_table({

View File

@ -632,6 +632,14 @@ end
function Snippet:trigger_expand(current_node, pos_id, env, indent_nodes)
local pos = vim.api.nvim_buf_get_extmark_by_id(0, session.ns_id, pos_id, {})
local pre_expand_res = self:event(
events.pre_expand,
{ expand_pos = pos, expand_pos_mark_id = pos_id }
) or {}
-- update pos, event-callback might have moved the extmark.
pos = vim.api.nvim_buf_get_extmark_by_id(0, session.ns_id, pos_id, {})
-- find tree-node the snippet should be inserted at (could be before another node).
local _, sibling_snippets, own_indx, parent_node =
node_util.snippettree_find_undamaged_node(pos, {
@ -697,11 +705,6 @@ function Snippet:trigger_expand(current_node, pos_id, env, indent_nodes)
end
end
local pre_expand_res = self:event(events.pre_expand, { expand_pos = pos })
or {}
-- update pos, event-callback might have moved the extmark.
pos = vim.api.nvim_buf_get_extmark_by_id(0, session.ns_id, pos_id, {})
Environ:override(env, pre_expand_res.env_override or {})
if indent_nodes then

View File

@ -59,19 +59,30 @@ end
-- subtle: `:lua` exits VISUAL, which means that the '< '>-marks will be set correctly!
-- Afterwards, we can just use <cmd>lua, which does not change the mode.
M.select_keys =
[[:lua require("luasnip.util.select").pre_cut()<Cr>gv"zs<cmd>lua require('luasnip.util.select').post_cut("z")<Cr>]]
M.cut_keys =
[[<Esc><cmd>lua require("luasnip.util.select").pre_yank("z")<Cr>gv"zs<cmd>lua require('luasnip.util.select').post_yank("z")<Cr>]]
local saved_registers
local lines
local start_line, start_col, end_line, end_col
local mode
function M.pre_cut()
function M.pre_yank(yank_register)
-- store registers so we don't change any of them.
-- "" is affected since we perform a cut (s), 1-9 also (although :h
-- quote_number seems to state otherwise for cuts to specific registers..?).
saved_registers =
store_registers("", "1", "2", "3", "4", "5", "6", "7", "8", "9", "z")
saved_registers = store_registers(
"",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
yank_register
)
-- store data needed for de-indenting lines.
start_line = vim.fn.line("'<") - 1
@ -83,9 +94,9 @@ function M.pre_cut()
mode = vim.fn.visualmode()
end
function M.post_cut(register_name)
function M.post_yank(yank_register)
-- remove trailing newline.
local chunks = vim.split(vim.fn.getreg(register_name):gsub("\n$", ""), "\n")
local chunks = vim.split(vim.fn.getreg(yank_register):gsub("\n$", ""), "\n")
-- make sure to restore the registers to the state they were before cutting.
restore_registers(saved_registers)

View File

@ -1,4 +1,4 @@
*luasnip.txt* For NVIM v0.8.0 Last change: 2024 August 01
*luasnip.txt* For NVIM v0.8.0 Last change: 2024 August 28
==============================================================================
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|
>
__ ____
/\ \ /\ _`\ __
@ -3259,6 +3260,8 @@ The node and `event_args` can be accessed through `require("luasnip").session`:
`event_args`:
- `expand_pos`: `{<row>, <column>}`, position at which the snippet will be
expanded. `<row>` and `<column>` are both 0-indexed.
- `expand_pos_mark_id`: `number`, the id of the extmark luasnip uses to track
`expand_pos`. This may be moved around freely.
`event_res`:
- `env_override`: `map string->(string[]|string)`, override or extend the
snippets environment (`snip.env`).
@ -3364,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()`:
@ -3399,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
@ -3449,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*
@ -3518,7 +3547,7 @@ GENERAL ~
==============================================================================
31. API *luasnip-api*
32. API *luasnip-api*
`require("luasnip")`:

View File

@ -1,6 +1,6 @@
rock_manifest = {
doc = {
["luasnip.txt"] = "ab6768dea4b13a6eec600fa0b60b72c9"
["luasnip.txt"] = "56f185c21667b647e6d99e300a92fc49"
},
ftplugin = {
["snippets.vim"] = "f8c461751ad539fc449c15a85bf70be4"
@ -8,8 +8,8 @@ rock_manifest = {
lua = {
luasnip = {
["_types.lua"] = "a1b1fc45d496f8ece3e17dc3541e5f93",
["config.lua"] = "1bb0edf593b14b243b116d70cbb605c9",
["default_config.lua"] = "51eea9c217eed18af81d580129c70461",
["config.lua"] = "66f8d59053f6a1edfee8845e5afe0d6c",
["default_config.lua"] = "787cac3056704f9ca6e93030bbdf3c36",
extras = {
["_extra_types.lua"] = "b8f4a120d5abe22f0112efdcae358817",
["_lambda.lua"] = "e94a2ad0606ed3c4276a573d4e7ab205",
@ -32,7 +32,7 @@ rock_manifest = {
["treesitter_postfix.lua"] = "42a5143ad3c647d292b2183566fd6776"
},
["health.lua"] = "b6bd288f728f6897674347ad46917a5b",
["init.lua"] = "96451aae98dbaf3ece53873298479172",
["init.lua"] = "702ec608eb5de12e5fb1e73ed5aa8a90",
loaders = {
["data.lua"] = "498490d7dfcf2f0374b0d20f429ba6fb",
["from_lua.lua"] = "78d20ec3694e16581e21ed4948c26385",
@ -55,7 +55,7 @@ rock_manifest = {
["multiSnippet.lua"] = "2eab1e75c5ee87096f03db006da31844",
["node.lua"] = "c1d2f45dd25dcf5c1574ff63e0f9e88c",
["restoreNode.lua"] = "9613ce23458968aa12737365dd302be7",
["snippet.lua"] = "d6a31a62f45a460bc642822b6d0244f7",
["snippet.lua"] = "352d6ba76f615a833c6de4a1793f485a",
["snippetProxy.lua"] = "68262858f0f9a20a41640d5a11c43481",
["textNode.lua"] = "c22395ab8305a581f021982cd88e2931",
util = {
@ -96,7 +96,7 @@ rock_manifest = {
},
["path.lua"] = "3767ba134238fa42469cfcbcfdf16147",
["pattern_tokenizer.lua"] = "f4f99d27e6a6fb5385f583abc70beaab",
["select.lua"] = "b0a8180922f7995a86ea9df7eabb162e",
["select.lua"] = "2c46eb195573850fe2a3057ff534c464",
["str.lua"] = "06645f5bc876c73af9c4fd3296d620e0",
["table.lua"] = "f4a54a5775133c776d65643be728cfdb",
["time.lua"] = "54483e160266c85209e4399fbfc43e1b",

View File

@ -1 +1 @@
/nix/store/74x3q8qvr31hbdbk7zxckfvyd4q92d79-lua5.1-jsregexp-0.0.7-1 /nix/store/rn8bzg423wwkayzbsbmhmvcgjmbzrq5z-lua-5.1.5
/nix/store/5jji4dabr6sml48pyp2ap76yh58xd48r-lua5.1-jsregexp-0.0.7-1 /nix/store/k55zni8plmbwkbv9l6ds65p981ndxk7x-lua-5.1.5

View File

@ -1,6 +1,6 @@
rock_manifest = {
doc = {
["luasnip.txt"] = "ab6768dea4b13a6eec600fa0b60b72c9"
["luasnip.txt"] = "56f185c21667b647e6d99e300a92fc49"
},
ftplugin = {
["snippets.vim"] = "f8c461751ad539fc449c15a85bf70be4"
@ -8,8 +8,8 @@ rock_manifest = {
lua = {
luasnip = {
["_types.lua"] = "a1b1fc45d496f8ece3e17dc3541e5f93",
["config.lua"] = "1bb0edf593b14b243b116d70cbb605c9",
["default_config.lua"] = "51eea9c217eed18af81d580129c70461",
["config.lua"] = "66f8d59053f6a1edfee8845e5afe0d6c",
["default_config.lua"] = "787cac3056704f9ca6e93030bbdf3c36",
extras = {
["_extra_types.lua"] = "b8f4a120d5abe22f0112efdcae358817",
["_lambda.lua"] = "e94a2ad0606ed3c4276a573d4e7ab205",
@ -32,7 +32,7 @@ rock_manifest = {
["treesitter_postfix.lua"] = "42a5143ad3c647d292b2183566fd6776"
},
["health.lua"] = "b6bd288f728f6897674347ad46917a5b",
["init.lua"] = "96451aae98dbaf3ece53873298479172",
["init.lua"] = "702ec608eb5de12e5fb1e73ed5aa8a90",
loaders = {
["data.lua"] = "498490d7dfcf2f0374b0d20f429ba6fb",
["from_lua.lua"] = "78d20ec3694e16581e21ed4948c26385",
@ -55,7 +55,7 @@ rock_manifest = {
["multiSnippet.lua"] = "2eab1e75c5ee87096f03db006da31844",
["node.lua"] = "c1d2f45dd25dcf5c1574ff63e0f9e88c",
["restoreNode.lua"] = "9613ce23458968aa12737365dd302be7",
["snippet.lua"] = "d6a31a62f45a460bc642822b6d0244f7",
["snippet.lua"] = "352d6ba76f615a833c6de4a1793f485a",
["snippetProxy.lua"] = "68262858f0f9a20a41640d5a11c43481",
["textNode.lua"] = "c22395ab8305a581f021982cd88e2931",
util = {
@ -96,7 +96,7 @@ rock_manifest = {
},
["path.lua"] = "3767ba134238fa42469cfcbcfdf16147",
["pattern_tokenizer.lua"] = "f4f99d27e6a6fb5385f583abc70beaab",
["select.lua"] = "b0a8180922f7995a86ea9df7eabb162e",
["select.lua"] = "2c46eb195573850fe2a3057ff534c464",
["str.lua"] = "06645f5bc876c73af9c4fd3296d620e0",
["table.lua"] = "f4a54a5775133c776d65643be728cfdb",
["time.lua"] = "54483e160266c85209e4399fbfc43e1b",