From 3c71975851c489724c1bb04a575b6efef5224cc1 Mon Sep 17 00:00:00 2001 From: Dmitri Date: Fri, 16 May 2025 12:49:54 +0200 Subject: [PATCH] latex is working --- nvim/lua/kanopo/plugins/lsp.lua | 12 +++++++--- nvim/lua/kanopo/plugins/treesitter.lua | 32 +++++++++----------------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/nvim/lua/kanopo/plugins/lsp.lua b/nvim/lua/kanopo/plugins/lsp.lua index c2514c2..86eb2e3 100644 --- a/nvim/lua/kanopo/plugins/lsp.lua +++ b/nvim/lua/kanopo/plugins/lsp.lua @@ -62,12 +62,18 @@ return { ensure_installed = lsp_servers, automatic_installation = true }) + local capabilities = require('cmp_nvim_lsp').default_capabilities() + + -- Loop through all servers to set them up for _, lsp_server in pairs(lsp_servers) do - require("lspconfig")[lsp_server].setup({ + local server_config = { on_attach = on_attach, - capabilities = capabilities - }) + capabilities = capabilities, + } + + + require("lspconfig")[lsp_server].setup(server_config) end end } diff --git a/nvim/lua/kanopo/plugins/treesitter.lua b/nvim/lua/kanopo/plugins/treesitter.lua index 32f0a2d..44436c9 100644 --- a/nvim/lua/kanopo/plugins/treesitter.lua +++ b/nvim/lua/kanopo/plugins/treesitter.lua @@ -1,25 +1,15 @@ return { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", - config = function() - local configs = require("nvim-treesitter.configs") - - configs.setup({ - auto_install = true, - highlight = { - enable = true, - disable = function(lang, buf) - local max_filesize = 1024 * 1024 * 10 -- 10MB - local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) - if ok and stats and stats.size > max_filesize then - return true - end - end, - }, - indent = { - enable = true - }, - - }) - end + event = { "VeryLazy" }, + lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline + cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" }, + opts = { + highlight = { enable = true }, + indent = { enable = true }, + auto_install = { enable = true } + }, + config = function(_, opts) + require("nvim-treesitter.configs").setup(opts) + end, }