Update init.lua
This commit is contained in:
+1
-31
@@ -22,18 +22,7 @@ M.config = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function M.setup(opts)
|
function M.setup(opts)
|
||||||
opts = opts or {}
|
M.config = vim.tbl_deep_extend("force", M.config, 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)
|
|
||||||
|
|
||||||
-- Apply keybindings dynamically
|
-- Apply keybindings dynamically
|
||||||
for key, command in pairs(M.config.keybinds) do
|
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, {})
|
vim.api.nvim_create_user_command("JavaRun", M.run, {})
|
||||||
end
|
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
|
-- Open floating terminal
|
||||||
local function open_float_terminal(cmd)
|
local function open_float_terminal(cmd)
|
||||||
local ui = vim.api.nvim_list_uis()[1]
|
local ui = vim.api.nvim_list_uis()[1]
|
||||||
|
|||||||
Reference in New Issue
Block a user