Update config to astronvim V6
This commit is contained in:
@@ -1,14 +1,20 @@
|
||||
-- Customize Treesitter
|
||||
-- --------------------
|
||||
-- Treesitter customizations are handled with AstroCore
|
||||
-- as nvim-treesitter simply provides a download utility for parsers
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
{
|
||||
"neovim-treesitter/nvim-treesitter",
|
||||
lazy = false,
|
||||
dependencies = "AstroNvim/astrocore",
|
||||
branch = "main",
|
||||
main = "nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
-- add more things to the ensure_installed table protecting against community packs modifying it
|
||||
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, {
|
||||
"AstroNvim/astrocore",
|
||||
---@type AstroCoreOpts
|
||||
opts = {
|
||||
treesitter = {
|
||||
highlight = true, -- enable/disable treesitter based highlighting
|
||||
indent = true, -- enable/disable treesitter based indentation
|
||||
auto_install = true, -- enable/disable automatic installation of detected languages
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"vim",
|
||||
"cpp",
|
||||
"c",
|
||||
"bash",
|
||||
@@ -34,90 +40,8 @@ return {
|
||||
"typescript",
|
||||
"vimdoc",
|
||||
"xml"
|
||||
})
|
||||
end,
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup {
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false
|
||||
},
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"cpp",
|
||||
"c",
|
||||
"bash",
|
||||
"vim",
|
||||
"markdown",
|
||||
"asm",
|
||||
"cmake",
|
||||
"css",
|
||||
"html",
|
||||
"javascript",
|
||||
"printf",
|
||||
"fish",
|
||||
"git_config",
|
||||
"git_rebase",
|
||||
"gitcommit",
|
||||
"gitignore",
|
||||
"gitattributes",
|
||||
"java",
|
||||
"meson",
|
||||
"ninja",
|
||||
"python",
|
||||
"sql",
|
||||
"typescript",
|
||||
"vimdoc",
|
||||
"xml"
|
||||
}
|
||||
}
|
||||
end
|
||||
-- add more arguments for adding more treesitter parsers
|
||||
},
|
||||
},
|
||||
},
|
||||
-- init = function()
|
||||
-- vim.api.nvim_create_autocmd('FileType', {
|
||||
-- callback = function()
|
||||
-- -- Enable treesitter highlighting and disable regex syntax
|
||||
-- pcall(vim.treesitter.start)
|
||||
-- -- Enable treesitter-based indentation
|
||||
-- vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
-- end,
|
||||
-- }
|
||||
-- )
|
||||
-- local ensureInstalled = {
|
||||
-- "lua",
|
||||
-- "cpp",
|
||||
-- "c",
|
||||
-- "bash",
|
||||
-- "vim",
|
||||
-- "markdown",
|
||||
-- "asm",
|
||||
-- "cmake",
|
||||
-- "css",
|
||||
-- "html",
|
||||
-- "javascript",
|
||||
-- "printf",
|
||||
-- "fish",
|
||||
-- "git_config",
|
||||
-- "git_rebase",
|
||||
-- "gitcommit",
|
||||
-- "gitignore",
|
||||
-- "gitattributes",
|
||||
-- "java",
|
||||
-- "meson",
|
||||
-- "ninja",
|
||||
-- "python",
|
||||
-- "sql",
|
||||
-- "typescript",
|
||||
-- "vimdoc",
|
||||
-- "xml"
|
||||
-- -- ... your parsers
|
||||
-- }
|
||||
-- local alreadyInstalled = require('nvim-treesitter.config').get_installed()
|
||||
-- local parsersToInstall = vim.iter(ensureInstalled)
|
||||
-- :filter(function(parser)
|
||||
-- return not vim.tbl_contains(alreadyInstalled, parser)
|
||||
-- end)
|
||||
-- :totable()
|
||||
-- require('nvim-treesitter').install(parsersToInstall)
|
||||
-- end,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user