diff --git a/after/ftplugin/lua.lua b/after/ftplugin/lua.lua index cbea57fc..c471f768 100644 --- a/after/ftplugin/lua.lua +++ b/after/ftplugin/lua.lua @@ -8,13 +8,6 @@ wk.add({ end, desc = "Run buffer content", }, - { - "cl", - function() - require("luapad").init() - end, - desc = "Luapad", - }, { "ct", "lua MiniTest.run_file()", desc = "MiniTest for current file" }, { "cs", "lua MiniTest.run()", desc = "Run MiniTest suite" }, }) diff --git a/lua/core/plugins/luapad.lua b/lua/core/plugins/luapad.lua index c7eb813f..62a561c8 100644 --- a/lua/core/plugins/luapad.lua +++ b/lua/core/plugins/luapad.lua @@ -1,6 +1,18 @@ -local M = { - "rafcamlet/nvim-luapad", - ft = "lua", +local user_config = vim.g.config.plugins.luapad or {} + +local default_config = { + -- stylua: ignore start + keys = { + { "mL", function() require("luapad").init() end, desc = "Luapad", }, + }, + -- stylua: ignore end + opts = {}, } -return M \ No newline at end of file +local config = vim.tbl_deep_extend("force", default_config, user_config) + +return { + "rafcamlet/nvim-luapad", + keys = config.keys, + opts = config.opts, +}