AckslD / nvim-anywise-reg.lua

Plugin for making registers content-aware beyond char- and linewise
41 stars 1 forks source link

Request: Add a way to automatically support all textobjects defined #2

Open IndianBoy42 opened 3 years ago

IndianBoy42 commented 3 years ago

Enumerating all the text objects manually is kind of error prone and repetitive.

Also for some things like nvim-ts-hint-textobject. There is a lot of textobjects implicitly (m[a-z])

AckslD commented 3 years ago

This could be a nice setting in the config indeed! Do you think using all keybinds returned by :omap together with the ones listed in help objects would make sense in that case?

IndianBoy42 commented 3 years ago

I wonder if it's necessary to find all the text objects ahead of time. The reason being that some text objects have an initial binding to activate it and then take more input after like the ts-hint-textobject or some of the ones from vim-sandwhich. It seems like to support that we can't just use the result of omap. I'm actually not sure if this is possible

AckslD commented 3 years ago

It would indeed be nice to not know the text objects ahead of time. However. I'm not sure how to do it otherwise or if it's even possible. My initial plan was to essentially completely make use of TextYankPost, but the problem is that we can only know the operator in that event and not the text object.