From 5db010e870edc791138e6145b379c328029466f3 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sat, 28 Aug 2021 09:39:38 +0530 Subject: [PATCH] mv luasnip config to others.lua --- lua/plugins/configs/luasnip.lua | 11 ----------- lua/plugins/configs/others.lua | 13 +++++++++++++ lua/plugins/configs/statusline.lua | 2 +- lua/plugins/init.lua | 2 +- 4 files changed, 15 insertions(+), 13 deletions(-) delete mode 100644 lua/plugins/configs/luasnip.lua diff --git a/lua/plugins/configs/luasnip.lua b/lua/plugins/configs/luasnip.lua deleted file mode 100644 index aa14912..0000000 --- a/lua/plugins/configs/luasnip.lua +++ /dev/null @@ -1,11 +0,0 @@ -local present, luasnip = pcall(require, "luasnip") -if not present then - return -end - -luasnip.config.set_config { - history = true, - updateevents = "TextChanged,TextChangedI", -} - -require("luasnip/loaders/from_vscode").load() diff --git a/lua/plugins/configs/others.lua b/lua/plugins/configs/others.lua index 0364db1..a7f36a6 100644 --- a/lua/plugins/configs/others.lua +++ b/lua/plugins/configs/others.lua @@ -68,6 +68,19 @@ M.comment = function() end end +M.luasnip = function() + local present, luasnip = pcall(require, "luasnip") + if not present then + return + end + + luasnip.config.set_config { + history = true, + updateevents = "TextChanged,TextChangedI", + } + require("luasnip/loaders/from_vscode").load() +end + M.lspkind = function() local present, lspkind = pcall(require, "lspkind") if present then diff --git a/lua/plugins/configs/statusline.lua b/lua/plugins/configs/statusline.lua index 826e37f..cb4ff88 100644 --- a/lua/plugins/configs/statusline.lua +++ b/lua/plugins/configs/statusline.lua @@ -375,7 +375,7 @@ components.right.active[10] = { return " Bot " end local result, _ = math.modf((current_line / total_line) * 100) - return " " .. result .. " %% " + return " " .. result .. "%% " end, hl = { diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 1389d40..ff4c3a2 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -192,7 +192,7 @@ return packer.startup(function() wants = "friendly-snippets", after = "nvim-cmp", config = function() - require "plugins.configs.luasnip" + require("plugins.configs.others").luasnip() end, }