75 lines
1.4 KiB
Lua
75 lines
1.4 KiB
Lua
local M = {
|
|
{
|
|
"nvim-treesitter/nvim-treesitter",
|
|
branch = "main",
|
|
build = ":TSUpdate",
|
|
config = function()
|
|
local ensureInstalled = {
|
|
"lua",
|
|
"python",
|
|
"javascript",
|
|
"typescript",
|
|
"java",
|
|
"go",
|
|
"java",
|
|
"rust",
|
|
"html",
|
|
"css",
|
|
"json",
|
|
"yaml",
|
|
"markdown",
|
|
"sql",
|
|
"svelte",
|
|
"org",
|
|
}
|
|
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,
|
|
},
|
|
{
|
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
|
event = "VeryLazy",
|
|
branch = "main",
|
|
},
|
|
{
|
|
"HiPhish/rainbow-delimiters.nvim",
|
|
event = "VeryLazy",
|
|
},
|
|
{
|
|
"Wansmer/treesj",
|
|
event = "VeryLazy",
|
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
|
opts = { use_default_keymaps = false }, -- optional, if you don't want <space>m/j/s at all
|
|
keys = {
|
|
{
|
|
"ga",
|
|
function()
|
|
require("treesj").toggle()
|
|
end,
|
|
desc = "TreeSJ: toggle",
|
|
},
|
|
{
|
|
"gs",
|
|
function()
|
|
require("treesj").split()
|
|
end,
|
|
desc = "TreeSJ: split",
|
|
},
|
|
{
|
|
"gS",
|
|
function()
|
|
require("treesj").join()
|
|
end,
|
|
desc = "TreeSJ: join",
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
return M
|