-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: new command to goto hover (like goto definition) #12208
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
base: master
Are you sure you want to change the base?
Conversation
trying this feature out in my fork and loving it! except, I'd rather it be a horizontal split. I could also see an argument for |
Adding configuration for this small thing is easily going to be rejected by the maintainers. Other adjustments would also be increasing complexity and could delay this PR from being merged |
fair enough. let's get this merged first |
What you can also do, at least, if you are working with one pane, is transposing your layout with |
@TornaxO7 yep thank you! I am aware |
I just fixed it with merge conflicts since #10122 added support for hover with multiple language servers. This is how it looks like with multiple language servers: |
@nik-rev What do you think about making this work in-place instead of opening a new split? Similar to [keys.normal.g]
H = ["vsplit", "goto_definition"] Inspired by https://matklad.github.io/2024/10/08/two-tips.html, immediately thought of this PR while reading it :) |
That is definitely better! feels more natural, especially since it is very similar to other commands like "goto reference", but its "goto hover" |
So, you can use
Space + k
to hover documentation which opens a popup.However, sometimes it's really useful to be able to search inside this popup. Or go into it, move around, copy some text, etc. Some hover-docs can be quite long.
This PR adds a new command called
goto_hover
, which dumps the "documentation on hover" into a new scratch buffer (replacing the current buffer, similar togoto_definition
), where you can use your usual Helix motions. this is how it looks like (after I created a new split):I bound
goto_hover
toSpace + K
, whereashover
wasSpace + k
.Closes #12206
Closes #8134
Closes #9455