Files
vern-nvim/lua/Polydev/languages/lua.lua
T
DarthMooMancer a2c43661c4 rework: open_float_terminal uses table instead of string
fix: all languages now use proper terminal setup
2025-05-12 08:43:42 -04:00

20 lines
619 B
Lua

local utils = require("Polydev.utils")
local M = {}
function M.setup(user_opts)
local opts = vim.tbl_deep_extend("force", {}, require("Polydev.configs").get("lua"), user_opts or {})
vim.api.nvim_create_user_command("LuaRun", M.run, {})
for key, _ in pairs(opts.keybinds) do
vim.keymap.set("n", key, ":LuaRun<CR>", { silent = true })
end
end
function M.run()
local init_lua_path = utils.get_project_root() .. "/lua/" .. utils.get_project_name() .. "/init.lua"
if vim.fn.filereadable(init_lua_path) == 1 then
utils.open_float_terminal({ "lua " .. init_lua_path })
end
end
return M