From 0c2bd6e8c1af8f8a0588b6acd80cb7f7c613a8e6 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Sun, 25 Feb 2024 02:10:00 -0600 Subject: fix: windows path for lua libs --- lua/plugins/lspconfig.lua | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'lua/plugins/lspconfig.lua') diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 304bc5c..a2b1ee2 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -1,3 +1,15 @@ +local function get_lua_lib() + if vim.loop.os_uname().sysname == 'Linux' then + return { + vim.env.VIMRUNTIME, + os.getenv('HOME') .. '/.local/lib/lua', + } + end + return { + vim.env.VIMRUNTIME, + } +end + local servers = { clangd = {}, gopls = { -- just the key for the gopls config @@ -30,11 +42,7 @@ local servers = { telemetry = { enable = false }, workspace = { checkThirdParty = false, - library = { - vim.env.VIMRUNTIME, - -- need to check if there is a better directory - os.getenv('HOME') .. '/.local/lib/lua', - } + library = get_lua_lib(), }, }, }, -- cgit v1.2.3-54-g00ecf