mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-31 15:19:26 +02:00
Add Treesitter extensions for better textobjects (#700)
This adds three plugins that use treesitters parsing to provide smarter text objects [ts_textobjects](https://github.com/nvim-treesitter/nvim-treesitter-textobjects) lets you define text objects for things like functions and classes [ts_textsubjects](https://github.com/RRethy/nvim-treesitter-textsubjects.git) defines a smart text object that selects a semantic block around the cursor [ts_hintobjects](https://github.com/mfussenegger/nvim-ts-hint-textobject) uses easymotion style hint labeling to show all the surrounding semantic blocks, letting you choose the correct one I have also added which-key entries for all the above Co-authored-by: Christian Chiarulli <chris.machine@pm.me>
This commit is contained in:
parent
f7aeeba663
commit
6258b2b4ba
3 changed files with 154 additions and 10 deletions
|
@ -478,6 +478,24 @@ return require("packer").startup(function(use)
|
|||
requires = "hrsh7th/nvim-compe",
|
||||
disable = not O.plugin.tabnine.active,
|
||||
}
|
||||
|
||||
-- Custom semantic text objects
|
||||
use {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
disable = not O.plugin.ts_textobjects.active,
|
||||
}
|
||||
-- Smart text objects
|
||||
use {
|
||||
"RRethy/nvim-treesitter-textsubjects",
|
||||
disable = not O.plugin.ts_textsubjects.active,
|
||||
}
|
||||
-- Text objects using hint labels
|
||||
use {
|
||||
"mfussenegger/nvim-ts-hint-textobject",
|
||||
event = "BufRead",
|
||||
disable = not O.plugin.ts_hintobjects.active,
|
||||
}
|
||||
|
||||
for _, plugin in pairs(O.custom_plugins) do
|
||||
packer.use(plugin)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue