clean mappings.lua

This commit is contained in:
siduck 2022-04-28 04:34:14 +05:30
parent db18d5f356
commit 08da7f6698
2 changed files with 3 additions and 13 deletions

View File

@ -45,7 +45,7 @@ M.plugins = {
-- non plugin only
M.mappings = {
misc = nil,
misc = function() end,
}
return M

View File

@ -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", "<leader>uu", "<cmd> :NvChadUpdate <CR>")
-- 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 = {}