2021-07-17 11:14:52 +00:00
|
|
|
local present, ts_config = pcall(require, "nvim-treesitter.configs")
|
2021-11-17 05:30:57 +00:00
|
|
|
|
2021-07-17 11:14:52 +00:00
|
|
|
if not present then
|
2021-08-16 07:49:09 +00:00
|
|
|
return
|
2021-06-25 16:06:13 +00:00
|
|
|
end
|
|
|
|
|
2022-01-21 11:49:49 +00:00
|
|
|
local default = {
|
2021-08-16 07:49:09 +00:00
|
|
|
ensure_installed = {
|
|
|
|
"lua",
|
2021-11-19 01:47:09 +00:00
|
|
|
"vim",
|
2021-08-16 07:49:09 +00:00
|
|
|
},
|
|
|
|
highlight = {
|
|
|
|
enable = true,
|
|
|
|
use_languagetree = true,
|
|
|
|
},
|
2021-07-15 15:43:17 +00:00
|
|
|
}
|
2022-01-21 00:26:05 +00:00
|
|
|
|
2022-01-21 11:49:49 +00:00
|
|
|
local M = {}
|
|
|
|
M.setup = function(override_flag)
|
2022-01-21 00:26:05 +00:00
|
|
|
if override_flag then
|
2022-01-21 11:49:49 +00:00
|
|
|
default = require("core.utils").tbl_override_req("nvim_treesitter", default)
|
2022-01-21 00:26:05 +00:00
|
|
|
end
|
2022-01-21 11:49:49 +00:00
|
|
|
ts_config.setup(default)
|
2022-01-21 00:26:05 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
return M
|