Add treesitter for MacOS

This commit is contained in:
Eduardo Cueto-Mendoza 2024-05-02 15:28:53 +01:00
parent 5945db5567
commit b13a79d47b
2 changed files with 10 additions and 32 deletions

View File

@ -1,17 +1,16 @@
local lsp = require('lsp-zero')
--[[
local f = io.popen("uname -s")
if (f ~= nil) then
MY_OS = f:read("*a")
MY_OS = string.gsub(MY_OS, "%s+", "")
f:close()
end
]]--
print(_G.MY_OS)
lsp.preset("recommended")
if (MY_OS == 'Linux')
if (_G.MY_OS == 'Linux')
then
lsp.ensure_installed({
-- Replace these with whatever servers you want to install
@ -25,7 +24,7 @@ then
'rust_analyzer',
'zls'
})
elseif (MY_OS == 'FreeBSD') or (MY_OS == 'OpenBSD')
elseif (_G.MY_OS == 'FreeBSD') or (MY_OS == 'OpenBSD')
then
lsp.ensure_installed({
-- Replace these with whatever servers you want to install
@ -33,7 +32,7 @@ then
'ocamllsp',
'pylsp'
})
elseif (MY_OS == 'Darwin')
elseif (_G.MY_OS == 'Darwin')
then
lsp.ensure_installed({
-- Replace these with whatever servers you want to install
@ -47,7 +46,7 @@ then
'zls'
})
else
print('Should never be here')
print('Should never be here LSP')
end
local cmp = require("cmp")
@ -82,7 +81,7 @@ lsp.on_attach(function(client, bufnr)
end)
if (MY_OS == 'Linux')
if (_G.MY_OS == 'Linux')
then
-- Installed for Linux
require('lspconfig').bashls.setup({})
@ -163,7 +162,7 @@ then
require('lspconfig').zls.setup({})
elseif (MY_OS == 'FreeBSD') or (MY_OS == 'OpenBSD')
elseif (_G.MY_OS == 'FreeBSD') or (_G.MY_OS == 'OpenBSD')
then
-- Installed for BSD
require('lspconfig').bashls.setup({})
@ -186,7 +185,7 @@ then
require('lspconfig').zls.setup({})
elseif (MY_OS == 'Darwin')
elseif (_G.MY_OS == 'Darwin')
then
-- Installed for Linux
require('lspconfig').clangd.setup({})
@ -265,7 +264,7 @@ then
require('lspconfig').zls.setup({})
else
print('Should never be here')
print('Should never be here LSP config')
end

View File

@ -1,25 +1,4 @@
require('eddie.lazy')
require('eddie.remaps')
require('eddie.options')
local f = io.popen("uname -s")
if (f ~= nil) then
MY_OS = f:read("*a")
MY_OS = string.gsub(MY_OS, "%s+", "")
f:close()
end
--[[
if (MY_OS == 'Linux')
then
print('Should be here if on Linux')
elseif (MY_OS == 'FreeBSD') or (MY_OS == 'OpenBSD')
then
print('Should be here if on BSD')
else
print('Should never be here')
end
]]--
require('eddie.get_os')