Add selectors for textobjects function and class and move for parameters, and cursor context

This commit is contained in:
Fabian Schmidt
2024-09-17 13:11:06 +02:00
parent f942ea2f91
commit 9b831f0e3a
2 changed files with 35 additions and 0 deletions

View File

@@ -39,6 +39,39 @@ return {
end,
dependencies = { 'nvim-treesitter/playground' }
},
{
"nvim-treesitter/nvim-treesitter-context",
dependencies = { 'nvim-treesitter/nvim-treesitter' }
},
{
"nvim-treesitter/nvim-treesitter-textobjects",
dependencies = { 'nvim-treesitter/nvim-treesitter' },
config = function()
require("nvim-treesitter.configs").setup({
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
}
},
swap = {
enable = true,
swap_next = {
["<leader>a"] = "@parameter.inner",
},
swap_previous = {
["<leader>A"] = "@parameter.inner",
},
},
}
})
end
},
{
'akinsho/bufferline.nvim',
version = "*",