2024-02-10 18:22:09 +01:00
|
|
|
local ls = require("luasnip")
|
|
|
|
local types = require("luasnip.util.types")
|
|
|
|
|
|
|
|
-- Every unspecified option will be set to the default.
|
|
|
|
ls.setup({
|
|
|
|
history = true,
|
|
|
|
|
|
|
|
-- Update more often, :h events for more info.
|
|
|
|
update_events = "TextChanged,TextChangedI",
|
|
|
|
-- Snippets aren't automatically removed if their text is deleted.
|
|
|
|
-- `delete_check_events` determines on which events (:h events) a check for
|
|
|
|
-- deleted snippets is performed.
|
|
|
|
-- This can be especially useful when `history` is enabled.
|
|
|
|
delete_check_events = "TextChanged",
|
|
|
|
ext_opts = {
|
|
|
|
[types.choiceNode] = {
|
|
|
|
active = {
|
|
|
|
virt_text = { { "<--", "Error" } },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-08-18 15:17:43 +02:00
|
|
|
ft_func = require("luasnip.extras.filetype_functions").from_pos_or_filetype,
|
2024-02-10 18:22:09 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/snippets" })
|