From 5a0053d382bbfa939ee2942f1957a64a81f65019 Mon Sep 17 00:00:00 2001 From: justforlxz Date: Thu, 7 Sep 2023 16:33:38 +0800 Subject: [PATCH] chore(settings): move the config of treesitter to core.settings - Allow user config to add new treesitter language --- lua/core/settings.lua | 27 +++++++++++++++++++++++ lua/modules/configs/editor/treesitter.lua | 23 +------------------ 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/lua/core/settings.lua b/lua/core/settings.lua index b005f8e6f..60a146150 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -123,4 +123,31 @@ settings["dap_deps"] = { "python", -- Python (debugpy) } +-- Set here the Treesitter that will be installed and configured during boot. +-- Check the below link for all supported languages: +-- https://github.com/nvim-treesitter/nvim-treesitter#supported-languages +---@type string[] +settings["treesitter_deps"] = { + "bash", + "c", + "cpp", + "css", + "go", + "gomod", + "html", + "javascript", + "json", + "latex", + "lua", + "make", + "markdown", + "markdown_inline", + "python", + "rust", + "typescript", + "vimdoc", + "vue", + "yaml", +} + return require("modules.utils").extend_config(settings, "user.settings") diff --git a/lua/modules/configs/editor/treesitter.lua b/lua/modules/configs/editor/treesitter.lua index d9d352a25..a0f6fe43d 100644 --- a/lua/modules/configs/editor/treesitter.lua +++ b/lua/modules/configs/editor/treesitter.lua @@ -5,28 +5,7 @@ return vim.schedule_wrap(function() vim.api.nvim_set_option_value("foldexpr", "nvim_treesitter#foldexpr()", {}) require("modules.utils").load_plugin("nvim-treesitter", { - ensure_installed = { - "bash", - "c", - "cpp", - "css", - "go", - "gomod", - "html", - "javascript", - "json", - "latex", - "lua", - "make", - "markdown", - "markdown_inline", - "python", - "rust", - "typescript", - "vimdoc", - "vue", - "yaml", - }, + ensure_installed = require("core.settings")["treesitter_deps"], highlight = { enable = true, disable = function(ft, bufnr)