From cfb96ceb8534b4bf756192cd3a580ea49968d7c6 Mon Sep 17 00:00:00 2001 From: ignuki Date: Sun, 30 Mar 2025 13:38:38 +0200 Subject: [PATCH] prepare for custom snippets --- nvim/.config/nvim/lua/plugins/snippets.lua | 17 +++++++++++++++-- nvim/.config/nvim/snippets/.gitkeep | 0 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 nvim/.config/nvim/snippets/.gitkeep diff --git a/nvim/.config/nvim/lua/plugins/snippets.lua b/nvim/.config/nvim/lua/plugins/snippets.lua index 95aa6f5..4244939 100644 --- a/nvim/.config/nvim/lua/plugins/snippets.lua +++ b/nvim/.config/nvim/lua/plugins/snippets.lua @@ -1,9 +1,22 @@ return { { "L3MON4D3/LuaSnip", - -- follow latest release. - version = "v2.*", -- Replace by the latest released major (first number of latest release) + dependencies = { + "rafamadriz/friendly-snippets", + }, -- install jsregexp (optional!). build = "make install_jsregexp", + config = function() + local ls = require("luasnip") + local s = ls.snippet + local t = ls.text_node + local i = ls.insert_node + + ls.add_snippets("lua", { + s("hello", { + t('print("hello world!")'), + }), + }) + end, }, } diff --git a/nvim/.config/nvim/snippets/.gitkeep b/nvim/.config/nvim/snippets/.gitkeep new file mode 100644 index 0000000..e69de29