Skip to content

Commit

Permalink
feat!: Luapad config refactoring
Browse files Browse the repository at this point in the history
I want to be able to start Luapad always as Neovim gets more and more
a Lua interpreter and also a text editor ;)
  • Loading branch information
Allaman committed Dec 10, 2024
1 parent cec64d6 commit a15b9cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
7 changes: 0 additions & 7 deletions after/ftplugin/lua.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ wk.add({
end,
desc = "Run buffer content",
},
{
"<leader>cl",
function()
require("luapad").init()
end,
desc = "Luapad",
},
{ "<leader>ct", "<cmd>lua MiniTest.run_file()<cr>", desc = "MiniTest for current file" },
{ "<leader>cs", "<cmd>lua MiniTest.run()<cr>", desc = "Run MiniTest suite" },
})
20 changes: 16 additions & 4 deletions lua/core/plugins/luapad.lua
Original file line number Diff line number Diff line change
@@ -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 = {
{ "<leader>mL", function() require("luapad").init() end, desc = "Luapad", },
},
-- stylua: ignore end
opts = {},
}

return M
local config = vim.tbl_deep_extend("force", default_config, user_config)

return {
"rafcamlet/nvim-luapad",
keys = config.keys,
opts = config.opts,
}

0 comments on commit a15b9cd

Please sign in to comment.