diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua index ac7f1d2..ff2887d 100644 --- a/lua/lspconfig/lua.lua +++ b/lua/lspconfig/lua.lua @@ -49,3 +49,27 @@ for k, lang in pairs(servers) do end } end + +-- lua lsp settings +USER = "/home/" .. vim.fn.expand("$USER") + +local sumneko_root_path = USER .. "/.config/lua-language-server" +local sumneko_binary = USER .. "/.config/lua-language-server/bin/Linux/lua-language-server" + +require "lspconfig".sumneko_lua.setup { + cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}, + settings = { + Lua = { + runtime = { + version = "LuaJIT", + path = vim.split(package.path, ";") + }, + diagnostics = { + globals = {"vim"} + }, + workspace = { + library = {[vim.fn.expand("$VIMRUNTIME/lua")] = true, [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true} + } + } + }, +}