From b237481e89c454d52b6ab788bc75b11d96f60676 Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Fri, 11 Nov 2022 18:47:09 +0100 Subject: [PATCH] update nvim config --- .config/nvim/lua/maps.lua | 5 +++++ .config/nvim/lua/pluginconf/nvim_luasnip.lua | 22 ++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/.config/nvim/lua/maps.lua b/.config/nvim/lua/maps.lua index 3c0f3e0..28cf289 100644 --- a/.config/nvim/lua/maps.lua +++ b/.config/nvim/lua/maps.lua @@ -31,3 +31,8 @@ map("n", "gr", "lua vim.lsp.buf.references()", opts) map("n", "e", "lua vim.diagnostic.open_float()", opts) map("n", "-d", "lua vim.diagnostic.goto_next()", opts) map("n", "-r", "lua vim.lsp.buf.format { asnyc = true }", opts) + +-- command to stop LSP servers +vim.api.nvim_create_user_command("StopLsps", function() + vim.lsp.stop_client(vim.lsp.get_active_clients()) +end, { nargs = 0 }) diff --git a/.config/nvim/lua/pluginconf/nvim_luasnip.lua b/.config/nvim/lua/pluginconf/nvim_luasnip.lua index aad716f..3146878 100644 --- a/.config/nvim/lua/pluginconf/nvim_luasnip.lua +++ b/.config/nvim/lua/pluginconf/nvim_luasnip.lua @@ -8,6 +8,7 @@ local s = ls.snippet --local sn = ls.snippet_node local t = ls.text_node local fmt = require("luasnip.extras.fmt").fmt +local rep = require("luasnip.extras").rep require("luasnip.loaders.from_vscode").load() require("luasnip.loaders.from_snipmate").load() @@ -37,3 +38,24 @@ public Packet getDescriptionPacket() {{ ), s("markForUpdate", t [[this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);]]), }) + +ls.add_snippets("json", { + s( + "sound", + fmt( + [["{name0}": {{ + "category": "master", + "sounds": [ + {{ + "name": "{name1}", + "stream": false + }} + ] +}},]] , + { + name0 = i(1), + name1 = rep(1), + } + ) + ), +})