Can differentiate Linux by architecture

This commit is contained in:
Eduardo Cueto-Mendoza 2024-05-07 12:26:56 +01:00
parent 33e13ebba6
commit 8fdd515d06
1 changed files with 34 additions and 12 deletions

View File

@ -7,22 +7,44 @@ if (f ~= nil) then
f:close()
end
local f = io.popen("uname -m")
if (f ~= nil) then
MY_ARCH = f:read("*a")
MY_ARCH = string.gsub(MY_ARCH, "%s+", "")
f:close()
end
lsp.preset("recommended")
if (MY_OS == 'Linux')
then
lsp.ensure_installed({
-- Replace these with whatever servers you want to install
'bashls',
'clangd',
'julials',
'lua_ls',
'ltex',
'ocamllsp',
'pylsp',
'rust_analyzer',
'zls'
})
if (MY_ARCH == 'aarch64')
then
lsp.ensure_installed({
-- Replace these with whatever servers you want to install
'bashls',
'julials',
'ltex',
'ocamllsp',
'pylsp',
'rust_analyzer',
'zls'
})
else
lsp.ensure_installed({
-- Replace these with whatever servers you want to install
'bashls',
'clangd',
'julials',
'lua_ls',
'ltex',
'ocamllsp',
'pylsp',
'rust_analyzer',
'zls'
})
end
elseif (MY_OS == 'FreeBSD') or (MY_OS == 'OpenBSD')
then
lsp.ensure_installed({