diff --git a/lua/plugins/config.lua b/lua/plugins/config.lua index fa2bd95..7381f4a 100644 --- a/lua/plugins/config.lua +++ b/lua/plugins/config.lua @@ -180,19 +180,34 @@ function M.nvim_treesitter() local highlight_disable = { typescript = true, tsx = true, - --html = true, javascript = true, cpp = true, } - local rainbow_disable = vim.tbl_extend("force", highlight_disable, { svelte = true, html = true, query = true }) + local rainbow_disable = vim.tbl_extend("force", highlight_disable, { + svelte = true, + html = true, + query = true, + }) local too_many_lines = function(bufnr) return vim.api.nvim_buf_line_count(bufnr) > 5000 end require("nvim-treesitter.configs").setup({ - ensure_installed = "all", - ignore_install = { "html" }, + ensure_installed = { + "python", + "htmldjango", + "lua", + "javascript", + "typescript", + "tsx", + "json", + "svelte", + "zig", + "vim", + "css", + "scheme", + }, highlight = { enable = true, disable = function(lang, bufnr) @@ -205,14 +220,12 @@ function M.nvim_treesitter() disable = function(lang, bufnr) return rainbow_disable[lang] or too_many_lines(bufnr) end, - extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean - max_file_lines = nil, -- Do not enable for files with more than n lines, int - --colors = {}, -- table of hex strings - --termcolors = {}, + extended_mode = false, + max_file_lines = nil, }, indent = { enable = false, - } + }, }) local version = vim.version() @@ -227,7 +240,7 @@ function M.nvim_treesitter() url = "/home/guy/code/treesitter/tree-sitter-htmldjango-myown", -- local path or git repo files = { "src/parser.c" }, -- optional entries: - --branch = "main", -- default branch in case of git repo if different from master + branch = "paired-tags", -- default branch in case of git repo if different from master --generate_requires_npm = false, -- if stand-alone parser without npm dependencies requires_generate_from_grammar = true, -- if folder contains pre-generated src/parser.c }, diff --git a/lua/plugins/startup.lua b/lua/plugins/startup.lua index 1663cdf..d6784ef 100644 --- a/lua/plugins/startup.lua +++ b/lua/plugins/startup.lua @@ -18,6 +18,7 @@ require("packer").startup(function(use) -- SESSION use("ThePrimeagen/harpoon") use("rmagatti/auto-session") + use("mbbill/undotree") -- GIT use("tpope/vim-fugitive") diff --git a/queries/html/highlights.scm b/queries/html/highlights.scm index 670694a..fa66c22 100644 --- a/queries/html/highlights.scm +++ b/queries/html/highlights.scm @@ -91,3 +91,7 @@ (quoted_attribute_value (attribute_value) @operator)) (#lua-match? @_alpine "^x[-]%l+$")) +[ + "endfor" + "endif" +] @keyword diff --git a/queries/htmldjango/highlights.scm b/queries/htmldjango/highlights.scm index 17718b1..a9e2596 100644 --- a/queries/htmldjango/highlights.scm +++ b/queries/htmldjango/highlights.scm @@ -39,4 +39,6 @@ "and" "is" "as" + "endfor" + "endif" ] @keyword