From cafd078e8f443369c0b86da9dd7eeca9a1e1d326 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 10 Sep 2021 16:21:54 +0530 Subject: [PATCH] fix esc_insertmode settings not getting applied in chadrc (#422) --- lua/core/mappings.lua | 4 ---- lua/plugins/configs/others.lua | 3 +++ lua/plugins/init.lua | 5 +---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index fd69e200..ce199cb5 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -120,10 +120,6 @@ end -- below are all plugin related mappings -M.better_escape = function() - vim.g.better_escape_shortcut = plugin_maps.better_escape.esc_insertmode or { "" } -end - M.bufferline = function() local m = plugin_maps.bufferline diff --git a/lua/plugins/configs/others.lua b/lua/plugins/configs/others.lua index 7199c89e..7d06c761 100644 --- a/lua/plugins/configs/others.lua +++ b/lua/plugins/configs/others.lua @@ -40,7 +40,10 @@ M.autosave = function() end M.better_escape = function() + local m = require("core.utils").load_config().mappings.plugin.better_escape.esc_insertmode + vim.g.better_escape_interval = config.options.plugin.esc_insertmode_timeout or 300 + vim.g.better_escape_shortcut = m end M.blankline = function() diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 73fc46ef..4a67097f 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -166,11 +166,8 @@ return packer.startup(function() "jdhao/better-escape.vim", disable = not plugin_status.esc_insertmode, event = "InsertEnter", - config = function() - require("plugins.configs.others").better_escape() - end, setup = function() - require("core.mappings").better_escape() + require("plugins.configs.others").better_escape() end, }