added rust analyzer to lspconfig

This commit is contained in:
Tiago Sousa 2024-02-08 15:03:11 +00:00
parent 0388b96afb
commit 6110d93076
2 changed files with 22 additions and 36 deletions

View file

@ -1,6 +1,6 @@
local colour = "catppuccin" local color = "catppuccin"
function SetColour() function SetColor()
vim.cmd.colorscheme(colour) vim.cmd.colorscheme(color)
end end
return { return {
@ -20,13 +20,14 @@ return {
treesitter_context = true, treesitter_context = true,
fidget = true, fidget = true,
}, },
SetColour() SetColor()
}) })
end end
}, },
{ {
"ellisonleao/gruvbox.nvim", "ellisonleao/gruvbox.nvim",
priority = 1000,
config = function() config = function()
require("gruvbox").setup({ require("gruvbox").setup({
italic = { italic = {
@ -37,7 +38,7 @@ return {
}, },
transparent_mode = true, transparent_mode = true,
}) })
SetColour() SetColor()
end end
}, },
} }

View file

@ -104,20 +104,6 @@ return {
path = "[path]", path = "[path]",
}, },
}, },
-- format = function(entry, vim_item)
-- -- Kind icons
-- vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
-- -- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
-- vim_item.menu = ({
-- buffer = "[buf]",
-- nvim_lsp = "[LSP]",
-- luasnip = "[snip]",
-- nvim_lsp_signature_help = "[Signature]",
-- nvim_lua = "[lua]",
-- path = "[path]",
-- })[entry.source.name]
-- return vim_item
-- end,
}, },
sources = cmp.config.sources( sources = cmp.config.sources(
{ {
@ -160,18 +146,6 @@ return {
cmp.config.compare.order, cmp.config.compare.order,
}, },
}, },
--confirm_opts = {
-- behavior = cmp.ConfirmBehavior.Replace,
-- select = false,
--},
-- window = {
-- documentation = cmp.config.window.bordered(),
-- completion = cmp.config.window.bordered({
-- winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,CursorLine:PmenuSel,Search:None"
-- })
-- },
experimental = { experimental = {
ghost_text = true, ghost_text = true,
native_menu = false, native_menu = false,
@ -195,15 +169,16 @@ return {
} }
} }
}) })
vim.api.nvim_create_augroup("_mason", { clear = true }) vim.api.nvim_create_augroup("_mason", { clear = true })
require("mason").setup({ require("mason").setup({
PATH = "skip", PATH = "skip",
ui = { ui = {
icons = { icons = {
package_installed = "", package_installed = "",
package_pending = "", package_pending = "󱥸",
package_uninstalled = "" package_uninstalled = ""
}, }
}, },
max_concurrent_installers = 10, max_concurrent_installers = 10,
}) })
@ -226,9 +201,19 @@ return {
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next) vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
-- external (non mason) lsps
lspconfig.rust_analyzer.setup({
on_init = on_init,
flags = lsp_flags,
capabilities = capabilities,
cmd = {
"rustup", "run", "stable", "rust-analyzer",
}
})
mason_lspconfig.setup({ mason_lspconfig.setup({
ensure_installed = { ensure_installed = {
lua_ls,
}, },
automatic_installation = true, automatic_installation = true,
handlers = { handlers = {