diff options
| author | srdusr <trevorgray@srdusr.com> | 2023-05-16 16:23:22 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2023-05-16 16:23:22 +0200 |
| commit | 414c6b7e5a0bde6c0af21ed2d545313d627b53b3 (patch) | |
| tree | e83ba1bf0451a7a08fa20e574295768566accf29 | |
| parent | 56288981105b36089d1abebebefd195e6f6385f4 (diff) | |
| download | dotfiles-414c6b7e5a0bde6c0af21ed2d545313d627b53b3.tar.gz dotfiles-414c6b7e5a0bde6c0af21ed2d545313d627b53b3.zip | |
Add configuration for snippets
| -rw-r--r-- | lua/plugins/snippets.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lua/plugins/snippets.lua b/lua/plugins/snippets.lua index e69de29..104bda8 100644 --- a/lua/plugins/snippets.lua +++ b/lua/plugins/snippets.lua @@ -0,0 +1,23 @@ +return { + { + "L3MON4D3/LuaSnip", + opts = { + history = true, + -- Allow autotrigger snippets + enable_autosnippets = true, + -- For equivalent of UltiSnips visual selection + store_selection_keys = "<Tab>", + -- Event on which to check for exiting a snippet's region + region_check_events = "InsertEnter", + -- ejmastnak uses InsertLeave, perhaps because he has history=false + delete_check_events = "TextChanged", + -- When to trigger update of active nodes' dependents, e.g. repeat nodes + update_events = "TextChanged,TextChangedI", + }, + config = function(_, opts) + require("luasnip").setup(opts) + -- TODO: better way to detect this relative to config dir? + require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/snippets/" }) + end, + }, +} |
