treesitter#2036 changed the way to configure treesitter. adjusted config for this
This commit is contained in:
@@ -4,7 +4,7 @@ return {
|
|||||||
build = ':TSUpdate',
|
build = ':TSUpdate',
|
||||||
event = { "BufReadPost", "BufNewFile" },
|
event = { "BufReadPost", "BufNewFile" },
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-treesitter.configs").setup {
|
require("nvim-treesitter").setup {
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"lua",
|
"lua",
|
||||||
"typescript",
|
"typescript",
|
||||||
@@ -26,35 +26,31 @@ return {
|
|||||||
},
|
},
|
||||||
indent = {
|
indent = {
|
||||||
enable = true
|
enable = true
|
||||||
|
},
|
||||||
|
textobjects = {
|
||||||
|
select = {
|
||||||
|
enable = true,
|
||||||
|
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
||||||
|
keymaps = {
|
||||||
|
-- You can use the capture groups defined in textobjects.scm
|
||||||
|
["afn"] = "@function.outer",
|
||||||
|
["ifn"] = "@function.inner",
|
||||||
|
["acl"] = "@class.outer",
|
||||||
|
["icl"] = "@class.inner",
|
||||||
|
["icm"] = "@comment.inner",
|
||||||
|
["acm"] = "@comment.outer",
|
||||||
|
["ib"] = "@block.inner",
|
||||||
|
["ab"] = "@block.outer",
|
||||||
|
["la"] = "@assignment.lhs",
|
||||||
|
["ra"] = "@assignment.lhs"
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
config = function()
|
|
||||||
require("nvim-treesitter.configs").setup {
|
|
||||||
textobjects = {
|
|
||||||
select = {
|
|
||||||
enable = true,
|
|
||||||
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
|
||||||
keymaps = {
|
|
||||||
-- You can use the capture groups defined in textobjects.scm
|
|
||||||
["afn"] = "@function.outer",
|
|
||||||
["ifn"] = "@function.inner",
|
|
||||||
["acl"] = "@class.outer",
|
|
||||||
["icl"] = "@class.inner",
|
|
||||||
["icm"] = "@comment.inner",
|
|
||||||
["acm"] = "@comment.outer",
|
|
||||||
["ib"] = "@block.inner",
|
|
||||||
["ab"] = "@block.outer",
|
|
||||||
["la"] = "@assignment.lhs",
|
|
||||||
["ra"] = "@assignment.lhs"
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user