From f016bf634e626552f34cbe76ca58a0ca4647d2c7 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Tue, 7 Sep 2021 15:18:33 +0530 Subject: [PATCH] fix lazyloading for autosave.nvim --- lua/plugins/configs/others.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/plugins/configs/others.lua b/lua/plugins/configs/others.lua index 735fb39..7199c89 100644 --- a/lua/plugins/configs/others.lua +++ b/lua/plugins/configs/others.lua @@ -1,5 +1,7 @@ local M = {} +local 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 +25,7 @@ M.autosave = function() end autosave.setup { - enabled = vim.g.auto_save or false, -- takes boolean value from init.lua + enabled = config.options.plugin.autosave, -- takes boolean value from chadrc.lua execution_message = "autosaved at : " .. vim.fn.strftime "%H:%M:%S", events = { "InsertLeave", "TextChanged" }, conditions = { @@ -38,7 +40,6 @@ M.autosave = function() end M.better_escape = function() - local config = require("core.utils").load_config() vim.g.better_escape_interval = config.options.plugin.esc_insertmode_timeout or 300 end