From 8e0dfc1de69a35142e84e39114282c1f25e16223 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 26 Sep 2021 07:03:00 +0530 Subject: [PATCH] fix : add path for luasnip snippets (#483) --- lua/core/default_config.lua | 3 +++ lua/plugins/configs/others.lua | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index 312500e..1e7f839 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -81,6 +81,9 @@ M.plugins = { nvimtree = { enable_git = 0, }, + luasnip = { + snippet_path = {}, + }, statusline = { -- statusline related options -- these are filetypes, not pattern matched -- shown filetypes will overrule hidden filetypes diff --git a/lua/plugins/configs/others.lua b/lua/plugins/configs/others.lua index 959e5f3..2d1576c 100644 --- a/lua/plugins/configs/others.lua +++ b/lua/plugins/configs/others.lua @@ -1,5 +1,6 @@ local M = {} +local chadrc_config = require("core.utils").load_config() M.autopairs = function() local present1, autopairs = pcall(require, "nvim-autopairs") local present2, autopairs_completion = pcall(require, "nvim-autopairs.completion.cmp") @@ -23,7 +24,7 @@ M.autosave = function() end autosave.setup { - enabled = config.plugins.options.autosave, -- takes boolean value from init.lua + enabled = chadrc_config.plugins.options.autosave, -- takes boolean value from init.lua execution_message = "autosaved at : " .. vim.fn.strftime "%H:%M:%S", events = { "InsertLeave", "TextChanged" }, conditions = { @@ -38,10 +39,9 @@ M.autosave = function() end M.better_escape = function() - local config = require("core.utils").load_config() require("better_escape").setup { - mapping = config.mappings.plugins.better_escape.esc_insertmode, - timeout = config.plugins.options.esc_insertmode_timeout, + mapping = chadrc_config.mappings.plugins.better_escape.esc_insertmode, + timeout = chadrc_config.plugins.options.esc_insertmode_timeout, } end @@ -101,7 +101,7 @@ M.luasnip = function() history = true, updateevents = "TextChanged,TextChangedI", } - require("luasnip/loaders/from_vscode").load() + require("luasnip/loaders/from_vscode").load { path = { chadrc_config.plugins.options.luasnip.snippet_path } } end M.neoscroll = function()