mirror of
https://github.com/prurigro/darkcloud-nvimconfig.git
synced 2024-12-21 23:40:23 -05:00
Add nvim-treesitter-textobjects with some friendly keybindings
This commit is contained in:
parent
806e7c5385
commit
f3ce98466e
4 changed files with 57 additions and 1 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -91,3 +91,6 @@
|
|||
[submodule "vim/bundle/cmp-async-path"]
|
||||
path = vim/bundle/cmp-async-path
|
||||
url = https://codeberg.org/FelipeLema/cmp-async-path
|
||||
[submodule "vim/bundle/nvim-treesitter-textobjects"]
|
||||
path = vim/bundle/nvim-treesitter-textobjects
|
||||
url = https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||
|
|
|
@ -130,6 +130,7 @@ For a complete list of mappings specific to **darkcloud-nvimconfig**, check the
|
|||
* [nvim-snippy](https://github.com/dcampos/nvim-snippy): Snippet plugin for Neovim written in Lua
|
||||
* [vim-snippets](https://github.com/honza/vim-snippets): Snippets files for various programming languages
|
||||
* [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter): Treesitter configurations and abstraction layer for Neovim
|
||||
* [nvim-treesitter-textobjects](https://github.com/nvim-treesitter/nvim-treesitter-textobjects): Syntax aware text-objects, select, move, swap, and peek support
|
||||
* [ReplaceWithRegister](https://github.com/vim-scripts/ReplaceWithRegister): Replace text with the contents of a register (for paste+replace without writing over the buffer)
|
||||
* [splitjoin.vim](https://github.com/AndrewRadev/splitjoin.vim): Simplifies the transition between multiline and single-line code
|
||||
* [tabular](https://github.com/godlygeek/tabular): Vim script for text filtering and alignment
|
||||
|
|
1
vim/bundle/nvim-treesitter-textobjects
Submodule
1
vim/bundle/nvim-treesitter-textobjects
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit b7a0bfa3e93697ca5b61b15df633404bf8f45883
|
|
@ -19,6 +19,57 @@ if (vim.g.enabletreesitter == 1) then
|
|||
enable = true,
|
||||
disable = {},
|
||||
additional_vim_regex_highlighting = false,
|
||||
}
|
||||
},
|
||||
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true, -- Automatically jump forward to textobj
|
||||
|
||||
keymaps = {
|
||||
[ "ac" ] = { query = "@class.outer", desc = "Select outer part of a class region" },
|
||||
[ "ic" ] = { query = "@class.inner", desc = "Select inner part of a class region" },
|
||||
[ "af" ] = { query = "@function.outer", desc = "Select outer part of a function region" },
|
||||
[ "if" ] = { query = "@function.inner", desc = "Select inner part of a function region" },
|
||||
[ "as" ] = { query = "@scope", query_group = "locals", desc = "Select language scope" },
|
||||
},
|
||||
|
||||
selection_modes = {
|
||||
[ "@parameter.outer" ] = "v",
|
||||
[ "@parameter.inner" ] = "v",
|
||||
[ "@class.inner" ] = "V",
|
||||
[ "@class.outer" ] = "V",
|
||||
[ "@function.outer" ] = "V",
|
||||
[ "@function.inner" ] = "V",
|
||||
},
|
||||
|
||||
include_surrounding_whitespace = false,
|
||||
},
|
||||
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
|
||||
goto_next_start = {
|
||||
[ "]c" ] = { query = "@class.outer", desc = "Next class start" },
|
||||
[ "]f" ] = { query = "@function.outer", desc = "Next function start" },
|
||||
},
|
||||
|
||||
goto_next_end = {
|
||||
[ "]C" ] = { query = "@class.outer", desc = "Next class end" },
|
||||
[ "]F" ] = { query = "@function.outer", desc = "Next function end" },
|
||||
},
|
||||
|
||||
goto_previous_start = {
|
||||
[ "[c" ] = { query = "@class.outer", desc = "Prevoius class start" },
|
||||
[ "[f" ] = { query = "@function.outer", desc = "Previous function start" },
|
||||
},
|
||||
|
||||
goto_previous_end = {
|
||||
[ "[C" ] = { query = "@class.outer", desc = "Previous class end" },
|
||||
[ "[F" ] = { query = "@function.outer", desc = "Previous function end" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue