Initial Commit
This commit is contained in:
commit
18da9560c6
31 changed files with 769 additions and 0 deletions
40
lua/plugins/treesitter-textobjects.lua
Normal file
40
lua/plugins/treesitter-textobjects.lua
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
init = function()
|
||||
local config = require 'nvim-treesitter.configs';
|
||||
config.setup({
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ao"] = "@comment.outer",
|
||||
["ic"] = { query = "@class.inner", desc = "Select inner part of a class region" },
|
||||
["as"] = { query = "@local.scope", query_group = "locals", desc = "Select language scope" },
|
||||
},
|
||||
selection_modes = {
|
||||
['@parameter.outer'] = 'v', -- charwise
|
||||
['@function.outer'] = 'V', -- linewise
|
||||
['@class.outer'] = '<c-v>', -- blockwise
|
||||
},
|
||||
include_surrounding_whitespace = true,
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>Ca"] = { query = "@parameter.inner", desc = "Swap with next parameter" },
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>CA"] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
end
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue