added explicit treesitter languages

This commit is contained in:
2023-01-03 07:31:48 -06:00
parent 2ac774d166
commit 635cc7a3ef
4 changed files with 30 additions and 10 deletions
+23 -10
View File
@@ -180,19 +180,34 @@ function M.nvim_treesitter()
local highlight_disable = { local highlight_disable = {
typescript = true, typescript = true,
tsx = true, tsx = true,
--html = true,
javascript = true, javascript = true,
cpp = 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) local too_many_lines = function(bufnr)
return vim.api.nvim_buf_line_count(bufnr) > 5000 return vim.api.nvim_buf_line_count(bufnr) > 5000
end end
require("nvim-treesitter.configs").setup({ require("nvim-treesitter.configs").setup({
ensure_installed = "all", ensure_installed = {
ignore_install = { "html" }, "python",
"htmldjango",
"lua",
"javascript",
"typescript",
"tsx",
"json",
"svelte",
"zig",
"vim",
"css",
"scheme",
},
highlight = { highlight = {
enable = true, enable = true,
disable = function(lang, bufnr) disable = function(lang, bufnr)
@@ -205,14 +220,12 @@ function M.nvim_treesitter()
disable = function(lang, bufnr) disable = function(lang, bufnr)
return rainbow_disable[lang] or too_many_lines(bufnr) return rainbow_disable[lang] or too_many_lines(bufnr)
end, end,
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean extended_mode = false,
max_file_lines = nil, -- Do not enable for files with more than n lines, int max_file_lines = nil,
--colors = {}, -- table of hex strings
--termcolors = {},
}, },
indent = { indent = {
enable = false, enable = false,
} },
}) })
local version = vim.version() 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 url = "/home/guy/code/treesitter/tree-sitter-htmldjango-myown", -- local path or git repo
files = { "src/parser.c" }, files = { "src/parser.c" },
-- optional entries: -- 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 --generate_requires_npm = false, -- if stand-alone parser without npm dependencies
requires_generate_from_grammar = true, -- if folder contains pre-generated src/parser.c requires_generate_from_grammar = true, -- if folder contains pre-generated src/parser.c
}, },
+1
View File
@@ -18,6 +18,7 @@ require("packer").startup(function(use)
-- SESSION -- SESSION
use("ThePrimeagen/harpoon") use("ThePrimeagen/harpoon")
use("rmagatti/auto-session") use("rmagatti/auto-session")
use("mbbill/undotree")
-- GIT -- GIT
use("tpope/vim-fugitive") use("tpope/vim-fugitive")
+4
View File
@@ -91,3 +91,7 @@
(quoted_attribute_value (attribute_value) @operator)) (quoted_attribute_value (attribute_value) @operator))
(#lua-match? @_alpine "^x[-]%l+$")) (#lua-match? @_alpine "^x[-]%l+$"))
[
"endfor"
"endif"
] @keyword
+2
View File
@@ -39,4 +39,6 @@
"and" "and"
"is" "is"
"as" "as"
"endfor"
"endif"
] @keyword ] @keyword