diff --git a/lazy-lock.json b/lazy-lock.json index da4a627..17dfaf3 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -39,7 +39,7 @@ "nvim-treesitter": { "branch": "master", "commit": "63260da18bf273c76b8e2ea0db84eb901cab49ce" }, "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "92e688f013c69f90c9bbd596019ec10235bc51de" }, - "nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" }, + "nvim-ts-rainbow2": { "branch": "master", "commit": "b3120cd5ae9ca524af9cb602f41e12e301fa985f" }, "nvim-web-devicons": { "branch": "master", "commit": "5de460ca7595806044eced31e3c36c159a493857" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "smart-splits.nvim": { "branch": "master", "commit": "c8a9173d70cbbd1f6e4a414e49e31df2b32a1362" }, diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 7b94922..631a208 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -328,12 +328,14 @@ return { -- for check startuptime { "dstein64/vim-startuptime", cmd = "StartupTime", event = "InsertEnter" }, -- for coloring pairs - { - "p00f/nvim-ts-rainbow", - event = "BufRead", - dependencies = "nvim-treesitter/nvim-treesitter", - }, + -- remark 20231101 - menyebabkan error treesitter + -- { + -- "p00f/nvim-ts-rainbow", + -- event = "BufRead", + -- dependencies = "nvim-treesitter/nvim-treesitter", + -- }, -- for git + { "HiPhish/nvim-ts-rainbow2", event = "BufRead", dependencies = "nvim-treesitter/nvim-treesitter" }, { "lewis6991/gitsigns.nvim", enabled = vim.fn.executable("git") == 1, diff --git a/lua/user/treesitter.lua b/lua/user/treesitter.lua index 9ad03d9..9544fe3 100644 --- a/lua/user/treesitter.lua +++ b/lua/user/treesitter.lua @@ -10,14 +10,28 @@ configs.setup({ ignore_install = { "phpdoc" }, -- List of parsers to ignore installing highlight = { enable = true, - disable = function(_, bufnr) return vim.b[bufnr].large_buf end, + disable = { "css" }, -- list of language that will be disabled + additional_vim_regex_highlighting = false, + }, + context_commentstring = { + enable = true, + enable_autocmd = false, + config = { + -- Languages that have a single comment style + typescript = "// %s", + css = "/* %s */", + scss = "/* %s */", + html = "", + svelte = "", + vue = "", + json = "", + }, }, - context_commentstring = { enable = true, enable_autocmd = false }, rainbow = { enable = true, disable = { "html" }, - extended_mode = false, - max_file_lines = nil, + equery = 'rainbow-parens', + strategy = require('ts-rainbow').strategy.global, }, autotag = { enable = true }, incremental_selection = { enable = true }, diff --git a/lua/user/treesitter_20231101.lua b/lua/user/treesitter_20231101.lua index f5e5fcc..9544fe3 100644 --- a/lua/user/treesitter_20231101.lua +++ b/lua/user/treesitter_20231101.lua @@ -30,8 +30,8 @@ configs.setup({ rainbow = { enable = true, disable = { "html" }, - extended_mode = false, - max_file_lines = nil, + equery = 'rainbow-parens', + strategy = require('ts-rainbow').strategy.global, }, autotag = { enable = true }, incremental_selection = { enable = true },