From e52160557aa294a63d9e8c4e58df3e350d67a425 Mon Sep 17 00:00:00 2001 From: asep komarudin Date: Wed, 1 Nov 2023 10:10:51 +0700 Subject: [PATCH] update --- lua/custom/plugins/treesitter.lua | 2 +- lua/user/treesitter.lua | 18 ++----------- lua/user/treesitter_20231101.lua | 42 +++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 17 deletions(-) create mode 100644 lua/user/treesitter_20231101.lua diff --git a/lua/custom/plugins/treesitter.lua b/lua/custom/plugins/treesitter.lua index 219a10f..d8e1a5f 100644 --- a/lua/custom/plugins/treesitter.lua +++ b/lua/custom/plugins/treesitter.lua @@ -1,5 +1,5 @@ return { - -- "nvim-treesitter/nvim-treesitter", + "nvim-treesitter/nvim-treesitter", -- config = function() -- -- require("nvim-treesitter.configs").setup({ -- -- ensure_installed = { "html", "css", "javascript" }, diff --git a/lua/user/treesitter.lua b/lua/user/treesitter.lua index f5e5fcc..9ad03d9 100644 --- a/lua/user/treesitter.lua +++ b/lua/user/treesitter.lua @@ -10,23 +10,9 @@ configs.setup({ ignore_install = { "phpdoc" }, -- List of parsers to ignore installing highlight = { enable = true, - 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 = "", - }, + disable = function(_, bufnr) return vim.b[bufnr].large_buf end, }, + context_commentstring = { enable = true, enable_autocmd = false }, rainbow = { enable = true, disable = { "html" }, diff --git a/lua/user/treesitter_20231101.lua b/lua/user/treesitter_20231101.lua new file mode 100644 index 0000000..f5e5fcc --- /dev/null +++ b/lua/user/treesitter_20231101.lua @@ -0,0 +1,42 @@ +local status_ok, configs = pcall(require, "nvim-treesitter.configs") +if not status_ok then + return +end +configs.setup({ + ensure_installed = { + "lua", + "vim", + }, + ignore_install = { "phpdoc" }, -- List of parsers to ignore installing + highlight = { + enable = true, + 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 = "", + }, + }, + rainbow = { + enable = true, + disable = { "html" }, + extended_mode = false, + max_file_lines = nil, + }, + autotag = { enable = true }, + incremental_selection = { enable = true }, + indent = { enable = true, disable = { "python", "css" } }, + autopairs = { + enable = true, + }, +})