diff --git a/neovim/init.lua b/neovim/init.lua index a060b89..506e50e 100644 --- a/neovim/init.lua +++ b/neovim/init.lua @@ -386,11 +386,26 @@ require("lazy").setup({ clangd = {}, gopls = {}, lua_ls = { + on_init = function(client) + local path = client.workspace_folders[1].name + if + vim.loop.fs_stat(path .. "/.luarc.json") + or vim.loop.fs_stat(path .. "/.luarc.jsonc") + then + return + end + client.config.settings.Lua = + vim.tbl_deep_extend("force", client.config.settings.Lua, { + runtime = { version = "LuaJIT" }, + workspace = { + checkThirdParty = false, + library = { vim.env.VIMRUNTIME }, + }, + }) + end, settings = { Lua = { - completion = { - callSnippet = "Replace", - }, + completion = { callSnippet = "Replace" }, }, }, },