my-nvim-lua/lua/custom/plugins/configs/treesitter.lua

116 lines
2.2 KiB
Lua
Raw Normal View History

return {
ensure_installed = {
2022-09-23 00:50:02 +00:00
"query",
"css",
"lua",
"go",
"rust",
"fish",
"bash",
"python",
"c",
2022-09-23 00:50:02 +00:00
"cpp",
"haskell",
"javascript",
"html",
"markdown",
"markdown_inline",
"make",
"sql",
"yaml",
"toml",
"vue",
},
2022-09-29 22:13:39 +00:00
highlight = {
enable = true,
disable = function (lang, bufnr)
return lang == "help"
end
},
incremental_selection = {
2022-10-09 02:51:47 +00:00
enable = true,
keymaps = {
init_selection = "<CR>",
node_incremental = "<Tab>",
scope_incremental = "<CR>",
node_decremental = "<S-Tab>",
}
},
2022-10-09 02:51:47 +00:00
-- textsubjects = {
-- enable = true,
-- prev_selection = "<Tab>",
-- keymaps = {
-- ["<CR>"] = "textsubjects-smart", -- works in visual mode
-- }
-- },
--
rainbow = {
enable = true,
extended_mode = true,
},
textobjects = {
enable = true,
select = {
enable = true,
lookahead = true,
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["af"] = "@function.outer",
["if"] = "@function.inner",
2022-10-09 14:54:29 +00:00
["aF"] = "@field.outer",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
["aC"] = "@conditional.outer",
["iC"] = "@conditional.inner",
["ae"] = "@block.outer",
["ie"] = "@block.inner",
["al"] = "@loop.outer",
["il"] = "@loop.inner",
["is"] = "@statement.inner",
["as"] = "@statement.outer",
["ad"] = "@comment.outer",
["am"] = "@call.outer",
["im"] = "@call.inner",
}
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
["]]"] = "@function.outer",
2022-10-09 02:51:47 +00:00
["]C"] = "@class.outer",
},
goto_next_end = {
["]["] = "@function.outer",
},
goto_previous_start = {
["[["] = "@function.outer",
2022-10-09 02:51:47 +00:00
["[C"] = "@class.outer"
},
goto_previous_end = {
["[]"] = "@function.outer",
}
},
swap = {
enable = true,
swap_next = {
["~"] = "@parameter.inner"
},
}
2022-09-23 00:50:02 +00:00
},
playground = {
enable = true,
}
}