Update treesitter to main
This commit is contained in:
parent
98d9158287
commit
76e71ac03f
|
@ -32,3 +32,15 @@ vim.api.nvim_create_autocmd({ "InsertEnter", "WinLeave" }, {
|
||||||
group = cursor_group,
|
group = cursor_group,
|
||||||
pattern = "*",
|
pattern = "*",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = require("tools.highlight"),
|
||||||
|
callback = function()
|
||||||
|
-- syntax highlighting, provided by Neovim
|
||||||
|
vim.treesitter.start()
|
||||||
|
-- folds, provided by Neovim
|
||||||
|
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||||
|
-- indentation, provided by nvim-treesitter
|
||||||
|
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
|
@ -4,27 +4,15 @@ return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-treesitter/nvim-treesitter-context",
|
"nvim-treesitter/nvim-treesitter-context",
|
||||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
{ "nvim-treesitter/nvim-treesitter-textobjects", branch = "main" },
|
||||||
"windwp/nvim-ts-autotag",
|
"windwp/nvim-ts-autotag",
|
||||||
},
|
},
|
||||||
|
lazy = false,
|
||||||
|
branch = "main",
|
||||||
|
build = ":TSUpdate",
|
||||||
opts = {
|
opts = {
|
||||||
-- Add languages to be installed here that you want installed for treesitter
|
-- Add languages to be installed here that you want installed for treesitter
|
||||||
ensure_installed = {
|
ensure_installed = require("tools.highlight"),
|
||||||
"c",
|
|
||||||
"cpp",
|
|
||||||
"go",
|
|
||||||
"lua",
|
|
||||||
"python",
|
|
||||||
"rust",
|
|
||||||
"tsx",
|
|
||||||
"typescript",
|
|
||||||
"vimdoc",
|
|
||||||
"vim",
|
|
||||||
"markdown",
|
|
||||||
"markdown_inline",
|
|
||||||
"bash",
|
|
||||||
"sql",
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
|
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
|
@ -91,10 +79,6 @@ return {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
|
||||||
require("nvim-treesitter.configs").setup(opts)
|
|
||||||
require("nvim-treesitter.install").update({ with_sync = true })
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter-context",
|
"nvim-treesitter/nvim-treesitter-context",
|
||||||
|
|
16
nvim/dot-config/nvim/lua/tools/highlight.lua
Normal file
16
nvim/dot-config/nvim/lua/tools/highlight.lua
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
return {
|
||||||
|
"c",
|
||||||
|
"cpp",
|
||||||
|
"go",
|
||||||
|
"lua",
|
||||||
|
"python",
|
||||||
|
"rust",
|
||||||
|
"tsx",
|
||||||
|
"typescript",
|
||||||
|
"vimdoc",
|
||||||
|
"vim",
|
||||||
|
"markdown",
|
||||||
|
"markdown_inline",
|
||||||
|
"bash",
|
||||||
|
"sql",
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user