Update init.lua

This commit is contained in:
DarthMooMancer
2025-03-05 09:52:22 -05:00
parent 52a133876d
commit 35e5dc7ff9
+1 -31
View File
@@ -22,18 +22,7 @@ M.config = {
}
function M.setup(opts)
opts = opts or {}
-- Apply default keybinds if not defined by user
if opts.keybinds then
for key, command in pairs(M.config.keybinds) do
if not opts.keybinds[key] then
opts.keybinds[key] = command
end
end
end
-- Merge the configurations
M.config = vim.tbl_deep_extend("force", M.config, opts)
M.config = vim.tbl_deep_extend("force", M.config, opts or {})
-- Apply keybindings dynamically
for key, command in pairs(M.config.keybinds) do
@@ -51,25 +40,6 @@ function M.setup(opts)
vim.api.nvim_create_user_command("JavaRun", M.run, {})
end
-- function M.setup(opts)
-- M.config = vim.tbl_deep_extend("force", M.config, opts or {})
--
-- -- Apply keybindings dynamically
-- for key, command in pairs(M.config.keybinds) do
-- if command == "CloseTerminal" then
-- M.close_key = key
-- else
-- vim.keymap.set("n", key, ":" .. command .. "<CR>", { silent = true })
-- end
-- end
--
-- -- Register user commands
-- vim.api.nvim_create_user_command("NewJavaProject", M.create_project, {})
-- vim.api.nvim_create_user_command("NewJavaFile", M.create_new_file, {})
-- vim.api.nvim_create_user_command("JavaBuild", M.build, {})
-- vim.api.nvim_create_user_command("JavaRun", M.run, {})
-- end
-- Open floating terminal
local function open_float_terminal(cmd)
local ui = vim.api.nvim_list_uis()[1]