diff options
author | Christian Segundo | 2024-12-08 13:06:41 +0100 |
---|---|---|
committer | Christian Segundo | 2024-12-08 13:06:41 +0100 |
commit | a459ffd8135d27499a616f5405468a1b20677223 (patch) | |
tree | 4a40f775e8f758d1c32636deb0b593de1ea14de4 /lua/plugins/core/treesitter.lua | |
parent | b0a97cff0312d0634442147bbe4a8c63c9e81e3d (diff) | |
download | config-a459ffd8135d27499a616f5405468a1b20677223.tar.gz |
misc stylua
Diffstat (limited to 'lua/plugins/core/treesitter.lua')
-rw-r--r-- | lua/plugins/core/treesitter.lua | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/lua/plugins/core/treesitter.lua b/lua/plugins/core/treesitter.lua index 065190f..f7b46b9 100644 --- a/lua/plugins/core/treesitter.lua +++ b/lua/plugins/core/treesitter.lua @@ -1,55 +1,55 @@ ---@param tbl table ---@return table local tbl_uniq = function(tbl) - ---@type table<string, boolean> - local added = {} - local res = {} - res = vim.tbl_filter(function(k) - if added[k] then - return false - end - added[k] = true - return true - end, tbl) + ---@type table<string, boolean> + local added = {} + local res = {} + res = vim.tbl_filter(function(k) + if added[k] then + return false + end + added[k] = true + return true + end, tbl) - return res + return res end return { - { - "nvim-treesitter/nvim-treesitter", - -- Disable for now, this has been a big source of pain and errors in the - -- past - enabled = false, - build = ":TSUpdate", - cmd = { "TSUpdateSync" }, - event = { "BufReadPost", "BufNewFile" }, - init = function() - vim.o.foldmethod = "expr" - vim.o.foldexpr = "nvim_treesitter#foldexpr()" - end, - opts = { - indent = { enable = true }, - ensure_installed = { "query" }, - ignore_install = {}, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - query_linter = { - enable = true, - use_virtual_text = true, - lint_events = { "BufWrite", "CursorHold" }, - }, - }, - config = function(_, opts) - if type(opts.ensure_installed) == "table" then - opts.ensure_installed = tbl_uniq(opts.ensure_installed) - end - if type(opts.ignore_install) == "table" then - opts.ignore_install = tbl_uniq(opts.ignore_install) - end - require("nvim-treesitter.configs").setup(opts) - end, - }, + { + "nvim-treesitter/nvim-treesitter", + -- Disable for now, this has been a big source of pain and errors in the + -- past + enabled = false, + build = ":TSUpdate", + cmd = { "TSUpdateSync" }, + event = { "BufReadPost", "BufNewFile" }, + init = function() + vim.o.foldmethod = "expr" + vim.o.foldexpr = "nvim_treesitter#foldexpr()" + end, + opts = { + indent = { enable = true }, + ensure_installed = { "query" }, + ignore_install = {}, + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + query_linter = { + enable = true, + use_virtual_text = true, + lint_events = { "BufWrite", "CursorHold" }, + }, + }, + config = function(_, opts) + if type(opts.ensure_installed) == "table" then + opts.ensure_installed = tbl_uniq(opts.ensure_installed) + end + if type(opts.ignore_install) == "table" then + opts.ignore_install = tbl_uniq(opts.ignore_install) + end + require("nvim-treesitter.configs").setup(opts) + end, + }, } |