-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add doc-fn/help-fn #2
Comments
I was thinking about it too as I migrate some of my settings to smart-jump-register.
The K and gf ends up being left out. There's probably a couple commands that would be better generalized. I think I won't support 'gf'/find file at point but the doc function seems interesting. I'll have to think about it a little before I do it, I kind of wanted to map 1:1 conceptually with xref (as well as dumb-jump) and adding doc seems to be out of that mapping. I'm probably 80% for it though. 👍 |
Is there a default help command for emacs? Something that matches evil's ~evil-lookup? Also, are you planning on using this from a fallback point of view or just want a convenient place to add the 'K' mapping too? |
What might be the most suitable as a default I guess would be I am using it from both fallback point of view and a convenient place to add the K mapping. My current setup is to use source-peek as the fallback method, as that by itself provides fall-backs for most languages. It is not really documentation lookup per se, but something I found useful. I have been considering using something like
|
FWIW I think it might make sense to make what you're describing as its own package (something like |
One thing I do like about adding the doc: key is that it puts alot of configuration into one place and makes it easier to manage. Most of those help commands comes from the same packages that supply the M-., M-,, M-? commands so it feels relatively natural to add them. I'm not sure how doc functions usually fail though. @terlar Do you think catching on the 'point' is a good enough heuristic to check for doc function failures? I'm guessing maybe not since the point might not move when a documentation window pops up. Also, nice compilation of those commands! @jacktasia I'd be curious about those details but also what you think the advantages are of one approach vs the other (merging vs splitting the package functionality). |
@jojojames This is obviously pretty subjective and I totally agree there's a case for combining them. I am supportive of any route you guys want to take, but since you asked my subjective thinking is mainly:
That's basically it. That said, if you guys decide to combine instead I think it would be neat to have an optional init func (like Happy to expand on anything if you guys want. 😄 |
@jacktasia I agree with all of your points. I'm thinking, initially we might want to combine the patterns into one and once we see a pattern emerge, we can think about splitting them up (since the core logic at this point is relatively simple). As for:
I completely agree and was thinking about adding something like that soon.
Definitely can empathize with that. |
Cool, that makes a lot of sense to me. |
@jacktasia I think those are good ideas, if a package could provide nice defaults so you just can just plug it in that would be really neat. But since it makes many assumptions it is important that it is customizeable and most important provide the functionality/platform to create configuration. Related to that note I have been thinking about something to configure "language" specific things, most people does it and this is just one of the things. Of course using @jojojames I also don't think doc functions fail and have fall-backs, but perhaps if there are some more generic tools like dash which searches through several sources that could act as a fallback, but I am a bit hesitant defaulting to tools that are external. Also what sets the |
@terlar Have you seen https://github.com/jojojames/evil-collection by the way? Even if help-fn isn't added to this, I'm thinking most modes will bind the 'K' key to those commands you listed. We could use your contributions there. :) Also if you had any jumps you were using, I'd encourage you to submit them in the form of a pull request so I can merge it in with this repo. |
Not really a jump thing, but figured it could fit nicely in there, this would add a function for documentation lookup, help for the current keyword. In vim/evil mode it is bound to K.
Currently I setup the
doc-fn
tohelpful-at-point
inemacs-mode
. I am not sure which name is better, eitherdoc-fn
orhelp-fn
.Thank you for this package, this is just something I have been thinking about configuring lately and this package will help greatly.
The text was updated successfully, but these errors were encountered: