Skip to content

Commit

Permalink
chore(settings): move the config of treesitter to core.settings
Browse files Browse the repository at this point in the history
- Allow user config to add new treesitter language
  • Loading branch information
justforlxz committed Sep 7, 2023
1 parent 6269bf4 commit 5a0053d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 22 deletions.
27 changes: 27 additions & 0 deletions lua/core/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
23 changes: 1 addition & 22 deletions lua/modules/configs/editor/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5a0053d

Please sign in to comment.