From c1d6bc6b4fd5208c7f3df0694f7aab501943981b Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sun, 13 Aug 2023 08:44:49 +0100 Subject: Adds primeagen neovim configuration --- nvim-primeagen/after/plugin/luasnip.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 nvim-primeagen/after/plugin/luasnip.lua (limited to 'nvim-primeagen/after/plugin/luasnip.lua') 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 = { { ">" } }, + }, + }, + }, +}) -- cgit v1.2.3