From 08da7f6698eec163c06c91a492bebc77894bbe3c Mon Sep 17 00:00:00 2001 From: siduck Date: Thu, 28 Apr 2022 04:34:14 +0530 Subject: [PATCH] clean mappings.lua --- lua/core/default_config.lua | 2 +- lua/core/mappings.lua | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index 88f2d71..74fd9f5 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -45,7 +45,7 @@ M.plugins = { -- non plugin only M.mappings = { - misc = nil, + misc = function() end, } return M diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index f32d1c3..9af8020 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -1,15 +1,8 @@ local utils = require "core.utils" -local config = utils.load_config() local map = utils.map - -local user_cmd = vim.api.nvim_create_user_command - -local nvChad_options = config.options.nvChad - -local mappings = config.mappings - local cmd = vim.cmd +local user_cmd = vim.api.nvim_create_user_command -- This is a wrapper function made to disable a plugin mapping from chadrc -- If keys are nil, false or empty string, then the mapping will be not applied @@ -87,10 +80,7 @@ cmd "silent! command! NvChadUpdate lua require('nvchad').update_nvchad()" map("n", "uu", " :NvChadUpdate ") -- load overriden misc mappings - -if mappings.misc ~= nil and type(mappings.misc) == "function" then - mappings.misc() -end +require("core.utils").load_config().mappings.misc() local M = {}