dotfiles/modules/programs/nvim/plugins/lua/luasnip.lua

26 lines
827 B
Lua
Raw Normal View History

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" } },
},
},
},
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" })