dotfiles/.config/nvim/lua/plugins/treesitter.lua

49 lines
1.4 KiB
Lua
Raw Normal View History

2024-06-01 03:53:39 +01:00
return {
{
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPost", "BufNewFile" },
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects'
},
config = function()
local treesitter = require("nvim-treesitter.configs")
require('nvim-treesitter.install').update({ with_sync = true })
2022-10-19 00:47:07 +01:00
2024-06-01 03:53:39 +01:00
local options = {
2024-09-12 21:41:15 +01:00
auto_install = true,
2024-06-01 03:53:39 +01:00
highlight = {
enable = true,
2024-10-07 20:16:38 +01:00
disable = { "latex" },
2024-06-01 03:53:39 +01:00
use_languagetree = true,
},
indent = {
enable = true,
},
}
2022-10-19 00:47:07 +01:00
2024-06-01 03:53:39 +01:00
treesitter.setup(options)
end
},
2024-06-01 03:53:39 +01:00
{
'echasnovski/mini.ai',
event = "VeryLazy",
version = false,
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects'
},
config = function()
local gen_spec = require('mini.ai').gen_spec
require('mini.ai').setup({
custom_textobjects = {
-- Function definition (needs treesitter queries with these captures)
F = gen_spec.treesitter({ a = '@function.outer', i = '@function.inner' }),
},
n_lines = 1000
})
end
},
2022-10-19 00:47:07 +01:00
}