Update treesitter config

This commit is contained in:
2023-09-04 03:42:41 +02:00
parent 85865ba429
commit 3f5579b350
2 changed files with 45 additions and 28 deletions
+44 -25
View File
@@ -17,53 +17,72 @@
-- https://github.com/nvim-treesitter/nvim-treesitter -- https://github.com/nvim-treesitter/nvim-treesitter
require("nvim-treesitter.configs").setup({ require("nvim-treesitter.configs").setup({
-- One of "all", "maintained" (parsers with maintainers), or a list of languages
ensure_installed = { ensure_installed = {
"bash", "bash",
"c", "c",
"cpp",
"cmake", "cmake",
"comment",
"cpp",
"css", "css",
"csv",
-- "d", -- requires treesitter cli?
"diff",
"dockerfile", "dockerfile",
"go", "doxygen",
"dtd",
"git_config",
"git_rebase",
"gitattributes",
"gitcommit",
"gitignore",
"groovy",
"hare",
"html", "html",
"ini",
"java", "java",
"javascript", "javascript",
"json", "json",
"json5",
"jsonc",
"latex",
"lua", "lua",
"luadoc",
"luap",
"make", "make",
"markdown",
"markdown_inline",
"meson",
"ninja", "ninja",
"norg",
"odin",
"perl",
"php",
"phpdoc",
"pymanifest",
"python", "python",
"regex",
"requirements",
"robot",
"rst",
"rust", "rust",
"sql",
"toml", "toml",
"typescript",
"vim", "vim",
"vimdoc",
"xml",
"yaml", "yaml",
"yang", "yang",
"zig",
}, },
-- Indentation based on treesitter for the = operator.
-- NOTE: This is an experimental feature.
indent = { indent = {
enable = true, enable = true,
}, },
-- Install languages synchronously (only applied to `ensure_installed`)
sync_install = false,
-- List of parsers to ignore installing
ignore_install = {},
highlight = {
-- `false` will disable the whole extension
enable = true,
-- list of language that will be disabled
disable = {},
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
}) })
-- vim.opt.foldmethod = "expr"
-- vim.opt.foldexpr = "nvim_treesitter#foldexpr()" vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
vim.opt.foldenable = false
+1 -3
View File
@@ -28,9 +28,7 @@ vim.opt.softtabstop = 4
vim.opt.expandtab = true vim.opt.expandtab = true
vim.opt.shiftwidth = 4 vim.opt.shiftwidth = 4
vim.opt.smarttab = false vim.opt.smarttab = false
-- Folds are configured in nvim-treesitter, but this needs to be set before -- Folds are configured in nvim-treesitter, so this is only for fallback
-- loading the first buffer which is not possible in nvim-treesitter.lua due to
-- lazy loading (I think)
vim.opt.foldlevelstart = 99 vim.opt.foldlevelstart = 99
vim.opt.foldmethod = "indent" vim.opt.foldmethod = "indent"
vim.opt.foldignore = "" vim.opt.foldignore = ""