summaryrefslogtreecommitdiffstats
path: root/nvim-primeagen/after/plugin/luasnip.lua
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-08-13 08:44:49 +0100
committerMatthew Lemon <y@yulqen.org>2023-08-13 08:44:49 +0100
commitc1d6bc6b4fd5208c7f3df0694f7aab501943981b (patch)
treeac34ead54ba6682a5c2e0d1a1f569346c76e9c90 /nvim-primeagen/after/plugin/luasnip.lua
parent39c92fea8b9e96b2756d94b285dae8cfb015d68f (diff)
Adds primeagen neovim configuration
Diffstat (limited to '')
-rw-r--r--nvim-primeagen/after/plugin/luasnip.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/nvim-primeagen/after/plugin/luasnip.lua b/nvim-primeagen/after/plugin/luasnip.lua
new file mode 100644
index 0000000..7f6bbde
--- /dev/null
+++ b/nvim-primeagen/after/plugin/luasnip.lua
@@ -0,0 +1,26 @@
+local has_words_before = function()
+ unpack = unpack or table.unpack
+ local line, col = unpack(vim.api.nvim_win_get_cursor(0))
+ return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
+end
+
+
+local ls = require("luasnip")
+
+ls.filetype_extend("htmldjango", {"html"})
+
+require("luasnip.loaders.from_lua").lazy_load({ paths = "~/.config/nvim/snippets" })
+require("luasnip.loaders.from_vscode").lazy_load()
+
+ls.config.set_config({
+ history = true,
+ updateevents = "TextChanged, TextChangedI", --update changes as you type
+ enable_autosnippets = true,
+ ext_opts = {
+ [require("luasnip.util.types").choiceNode] = {
+ active = {
+ virt_text = { { ">" } },
+ },
+ },
+ },
+})