From 16bb2fb8193d9415a2dcff1bff4418eacb8e5ce4 Mon Sep 17 00:00:00 2001 From: Ronald Record Date: Mon, 29 May 2023 11:46:30 -0700 Subject: [PATCH] Update to latest user template --- init.lua | 5 +++-- plugins/mason.lua | 28 +++++++++++++++++++--------- plugins/treesitter.lua | 9 ++++++--- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/init.lua b/init.lua index d6f5b96..fb34405 100644 --- a/init.lua +++ b/init.lua @@ -40,7 +40,8 @@ return { }, }, disabled = { -- disable formatting capabilities for the listed language servers - -- "sumneko_lua", + -- disable lua_ls formatting capability if you want to use StyLua to format your lua code + -- "lua_ls", }, timeout_ms = 1000, -- default format timeout -- filter = function(client) -- fully override the default formatting function @@ -59,7 +60,7 @@ return { performance = { rtp = { -- customize default disabled vim plugins - disabled_plugins = { "tohtml", "gzip", "matchit", "zipPlugin", "netrwPlugin", "tarPlugin", "matchparen" }, + disabled_plugins = { "tohtml", "gzip", "matchit", "zipPlugin", "netrwPlugin", "tarPlugin" }, }, }, }, diff --git a/plugins/mason.lua b/plugins/mason.lua index 9018347..6566f34 100644 --- a/plugins/mason.lua +++ b/plugins/mason.lua @@ -4,23 +4,33 @@ return { { "williamboman/mason-lspconfig.nvim", -- overrides `require("mason-lspconfig").setup(...)` - opts = { - -- ensure_installed = { "lua_ls" }, - }, + opts = function(_, opts) + -- add more things to the ensure_installed table protecting against community packs modifying it + opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, { + -- "lua_ls", + }) + end, }, -- use mason-null-ls to configure Formatters/Linter installation for null-ls sources { "jay-babu/mason-null-ls.nvim", -- overrides `require("mason-null-ls").setup(...)` - opts = { - -- ensure_installed = { "prettier", "stylua" }, - }, + opts = function(_, opts) + -- add more things to the ensure_installed table protecting against community packs modifying it + opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, { + -- "prettier", + -- "stylua", + }) + end, }, { "jay-babu/mason-nvim-dap.nvim", -- overrides `require("mason-nvim-dap").setup(...)` - opts = { - -- ensure_installed = { "python" }, - }, + opts = function(_, opts) + -- add more things to the ensure_installed table protecting against community packs modifying it + opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, { + -- "python", + }) + end, }, } diff --git a/plugins/treesitter.lua b/plugins/treesitter.lua index 092d7a8..18c6da6 100644 --- a/plugins/treesitter.lua +++ b/plugins/treesitter.lua @@ -1,6 +1,9 @@ return { "nvim-treesitter/nvim-treesitter", - opts = { - -- ensure_installed = { "lua" }, - }, + opts = function(_, opts) + -- add more things to the ensure_installed table protecting against community packs modifying it + opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, { + -- "lua" + }) + end, }