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

View File

@ -1,25 +1,4 @@
require('eddie.lazy') require('eddie.lazy')
require('eddie.remaps') require('eddie.remaps')
require('eddie.options') require('eddie.options')
require('eddie.get_os')
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
]]--