Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Suggestion: Hints for objects *outside* nodes containing the cursor #33

Open
chrisgrieser opened this issue Apr 1, 2023 · 3 comments

Comments

@chrisgrieser
Copy link

I just stumbled upon this plugin and I must say, I find it's concept very intriguing.

Having played around with it for a bit, I noticed that this plugin restricts the hints and therefore actionable area to nodes containing the cursor. When in a big, deeply nested node like in the demo in the readme, that makes sense, but when in areas with a long sequence of non-nested nodes like an array, this makes the plugin rather unuseful:
CleanShot 2023-04-01 at 14 56 06

So my idea is to introduce options to change the area actionable (= getting hints) from the plugin:

  • currently, we can action on nodes containing the cursor
  • one option could be nodes not containing the cursor, i.e. inverting the actionable area. This could be interesting, since you can often select things that contain the cursor via other text objects already. However, objects at a distance are far more limited to interact with (apart from the forward-seeking from plugins like targets.vim)
  • or one could simply enable hints for all nodes, or all nodes after/before the cursor?
@IndianBoy42
Copy link
Contributor

all nodes sounds like it would clutter up the screen quite a lot. playing with hop.nvim with some custom lua for using treesitter queries I am finding the screen gets very busy very quickly. you would have to be very careful about which nodes you show hints for.

@chrisgrieser
Copy link
Author

all nodes sounds like it would clutter up the screen quite a lot.

that does depend on your window size, which true, isn't that big for me most of the time. One could also restrict this to x lines below or above the cursor maybe?


Nevertheless, I made this to illustrate my point:
treehopper offers me hints to jump inside the current node (red), which isn't all to helpful here sind I can already reach various parts of this node via ii, ia, ac etc pretty easily.

What isn't quickly to reach are locations in neighboring nodes (blue) – but for those, treehopper does not offer hints.
CleanShot 2023-04-03 at 13 14 41@2x

@IndianBoy42
Copy link
Contributor

IndianBoy42 commented Apr 3, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants