From 5c7bbd33cd194fc82456c013a41f6f23f97d6ea4 Mon Sep 17 00:00:00 2001 From: Segcolt Date: Mon, 4 May 2026 18:36:35 -0300 Subject: [PATCH] Fix the config and add C# lsp --- lua/community.lua | 4 ++- lua/plugins/astrocore.lua | 10 +++++-- lua/plugins/mason.lua | 15 ++++++++++- lua/plugins/roslyn.lua | 9 +++++++ lua/plugins/treesitter.lua | 53 ++++++++++++++++++++++++++++++++++++-- 5 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 lua/plugins/roslyn.lua diff --git a/lua/community.lua b/lua/community.lua index 4cc72a8..e5585ab 100644 --- a/lua/community.lua +++ b/lua/community.lua @@ -25,13 +25,15 @@ return { { import = "astrocommunity.quickfix.nvim-bqf" }, + { import = "astrocommunity.markdown-and-latex.vimtex" }, + -- { import = "astrocommunity.diagnostics.lsp_lines-nvim" }, -- { import = "astrocommunity.diagnostics.trouble-nvim" }, { import = "astrocommunity.editing-support.rainbow-delimiters-nvim" }, - { import = "astrocommunity.editing-support.ultimate-autopair-nvim" }, + -- { import = "astrocommunity.editing-support.ultimate-autopair-nvim" }, { import = "astrocommunity.indent.mini-indentscope" }, diff --git a/lua/plugins/astrocore.lua b/lua/plugins/astrocore.lua index db2530c..2d0b83b 100644 --- a/lua/plugins/astrocore.lua +++ b/lua/plugins/astrocore.lua @@ -22,7 +22,7 @@ return { -- Configure core features of AstroNvim features = { large_buf = { size = 1024 * 500, lines = 10000 }, -- set global limits for large files for disabling features like treesitter - autopairs = true, -- enable autopairs at start + autopairs = false, -- enable autopairs at start cmp = true, -- enable completion at start diagnostics_mode = 3, -- diagnostic mode on start (0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on) highlighturl = true, -- highlight URLs at start @@ -56,12 +56,18 @@ return { mapleader = " ", -- sets vim.g.mapleader autoformat_enabled = false, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled) cmp_enabled = true, -- enable completion at start - autopairs_enabled = true, -- enable autopairs at start + autopairs_enabled = false, -- enable autopairs at start diagnostics_mode = 3, -- set the visibility of diagnostics in the UI (0=off, 1=only show in status line, 2=virtual text off, 3=all on) icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing) ui_notifications_enabled = true, -- disable notifications when toggling UI elements c_syntax_for_h = 1, wiki_root = '~/Documentos/Wiki', + -- vimtex + vimtex_view_method = "zathura", + vimtex_compiler_latexmk = { + aux_dir = "/run/user/1000/vimtex" + }, + -- wiki wiki_journal = { name = "journal", frequency = "daily", diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index c481c1b..d6609e0 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -11,7 +11,7 @@ return { "bashls", -- "pylsp"=, "pyright", - "cmake", + -- "cmake", "mesonlsp", "vimls", "cssls", @@ -19,6 +19,19 @@ return { }) end, }, + { + "williamboman/mason.nvim", + opts = { + registries = { + -- default Mason registry has highest priority + "github:mason-org/mason-registry", + -- Add the AstroNvim mason registry + "github:AstroNvim/mason-registry", + -- C# lsp + "github:Crashdummyy/mason-registry", + }, + }, + }, -- use mason-null-ls to configure Formatters/Linter installation for null-ls sources { "jay-babu/mason-null-ls.nvim", diff --git a/lua/plugins/roslyn.lua b/lua/plugins/roslyn.lua new file mode 100644 index 0000000..e33ea2e --- /dev/null +++ b/lua/plugins/roslyn.lua @@ -0,0 +1,9 @@ +return { + "seblyng/roslyn.nvim", + ---@module 'roslyn.config' + ---@type RoslynNvimConfig + opts = { + -- your configuration comes here; leave empty for default settings + }, + ft = "cs" +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index e53a360..a59a4c2 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,8 +1,10 @@ return { { - "nvim-treesitter/nvim-treesitter", + "neovim-treesitter/nvim-treesitter", lazy = false, dependencies = "AstroNvim/astrocore", + branch = "main", + main = "nvim-treesitter", opts = function(_, opts) -- add more things to the ensure_installed table protecting against community packs modifying it opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { @@ -70,5 +72,52 @@ return { } } end - } + }, + -- init = function() + -- vim.api.nvim_create_autocmd('FileType', { + -- callback = function() + -- -- Enable treesitter highlighting and disable regex syntax + -- pcall(vim.treesitter.start) + -- -- Enable treesitter-based indentation + -- vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + -- end, + -- } + -- ) + -- local ensureInstalled = { + -- "lua", + -- "cpp", + -- "c", + -- "bash", + -- "vim", + -- "markdown", + -- "asm", + -- "cmake", + -- "css", + -- "html", + -- "javascript", + -- "printf", + -- "fish", + -- "git_config", + -- "git_rebase", + -- "gitcommit", + -- "gitignore", + -- "gitattributes", + -- "java", + -- "meson", + -- "ninja", + -- "python", + -- "sql", + -- "typescript", + -- "vimdoc", + -- "xml" + -- -- ... your parsers + -- } + -- local alreadyInstalled = require('nvim-treesitter.config').get_installed() + -- local parsersToInstall = vim.iter(ensureInstalled) + -- :filter(function(parser) + -- return not vim.tbl_contains(alreadyInstalled, parser) + -- end) + -- :totable() + -- require('nvim-treesitter').install(parsersToInstall) + -- end, }