nvim: Update treesitter plugin for nvim 0.12
This commit is contained in:
@@ -1,20 +1,19 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = "main",
|
||||
lazy = false,
|
||||
event = {
|
||||
"BufReadPre",
|
||||
"BufNewFile",
|
||||
},
|
||||
main = "nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
dependencies = {
|
||||
"windwp/nvim-ts-autotag",
|
||||
},
|
||||
config = function(_, opts)
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
treesitter.setup(opts)
|
||||
end,
|
||||
opts = {
|
||||
config = function()
|
||||
require("nvim-treesitter").setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
@@ -24,7 +23,18 @@ return {
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
ensure_installed = {
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local parsers = {
|
||||
"bash",
|
||||
"css",
|
||||
"dockerfile",
|
||||
@@ -47,17 +57,14 @@ return {
|
||||
"twig",
|
||||
"vim",
|
||||
"yaml",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, lang in ipairs(parsers) do
|
||||
if not pcall(vim.treesitter.language.inspect, lang) then
|
||||
vim.cmd("TSInstall " .. lang)
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
|
||||
Reference in New Issue
Block a user