From 3077f933e46b06a34c4cc7eaa5116af31b949a95 Mon Sep 17 00:00:00 2001 From: minco Date: Wed, 22 Oct 2025 11:22:42 +0900 Subject: [PATCH] add luasnip --- lazy-lock.json | 2 ++ lua/plugins/lazydev.lua | 11 +++++++++++ lua/plugins/luasnip.lua | 10 ++++++++++ snippets/rust.json | 10 ++++++++++ 4 files changed, 33 insertions(+) create mode 100644 lua/plugins/lazydev.lua create mode 100644 lua/plugins/luasnip.lua create mode 100644 snippets/rust.json diff --git a/lazy-lock.json b/lazy-lock.json index bae718b..1aeec98 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -2,6 +2,7 @@ "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "Korean-IME.nvim": { "branch": "master", "commit": "c733599b9219e25bb05d8aa0467327edc769be94" }, + "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, "blink.download": { "branch": "main", "commit": "86361b98f3c8317904a08e3bd12cf3cdcbe3e925" }, "blink.nvim": { "branch": "main", "commit": "16a597e89cf2ee6215a392c5bc5a945477015534" }, @@ -13,6 +14,7 @@ "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, "hardtime.nvim": { "branch": "main", "commit": "b4e431934af1fe224a3a801f632c008278cb7628" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "e28ce52fc7ff79fcb76f0e79ee6fb6182fca90b9" }, "lazygit.nvim": { "branch": "main", "commit": "2305deed25bc61b866d5d39189e9105a45cf1cfb" }, "lsp-lens.nvim": { "branch": "main", "commit": "48bb1a7e271424c15f3d588d54adc9b7c319d977" }, "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, diff --git a/lua/plugins/lazydev.lua b/lua/plugins/lazydev.lua new file mode 100644 index 0000000..14f9b6e --- /dev/null +++ b/lua/plugins/lazydev.lua @@ -0,0 +1,11 @@ +return { + "folke/lazydev.nvim", + ft = "lua", -- only load on lua files + opts = { + library = { + -- See the configuration section for more details + -- Load luvit types when the `vim.uv` word is found + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, + }, + }, +} diff --git a/lua/plugins/luasnip.lua b/lua/plugins/luasnip.lua new file mode 100644 index 0000000..f53c391 --- /dev/null +++ b/lua/plugins/luasnip.lua @@ -0,0 +1,10 @@ +return { + "L3MON4D3/LuaSnip", + version = "v2.*", + dependencies = { "rafamadriz/friendly-snippets" }, + build = "make install_jsregexp", + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + require("luasnip.loaders.from_vscode").lazy_load({ paths = vim.fn.stdpath("config") .. "/snippets/" }) + end, +} diff --git a/snippets/rust.json b/snippets/rust.json new file mode 100644 index 0000000..8fa6503 --- /dev/null +++ b/snippets/rust.json @@ -0,0 +1,10 @@ +{ + "Rust Derive": { + "prefix": "derive", + "body": [ + "#[derive(Debug, Clone$1)]" + ], + "description": "Insert #[derive(...)] with cursor inside parentheses" + } +} +