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

docs: added a reference to relevant helptexts for motions #294

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

JL102
Copy link
Contributor

@JL102 JL102 commented Jan 3, 2024

Re: discussion #259
Added a reference to the relevant help text for motions, specifically for people who aren't super familiar with vim and never heard of text objects.

I think that the :h motion part is pretty facepalm-worthy obvious, but for someone who doesn't know about text-objects, I think it'd be hard to find info on a and i. But it would feel weird to give the suggestion for :h text-objects without mentioning :h motion.

@JL102 JL102 changed the title doc: added a reference to relevant helptexts for motions docs: added a reference to relevant helptexts for motions Jan 3, 2024
@kylechui
Copy link
Owner

kylechui commented Jan 5, 2024

I think I'm not opposed to adding "... or {text-object} ..." to the help docs; unsure if an explicit call-out is necessary since the point of the curly braces is to allow people to use K to visit them directly.

@JL102
Copy link
Contributor Author

JL102 commented Jan 11, 2024

I think I'm not opposed to adding "... or {text-object} ..." to the help docs; unsure if an explicit call-out is necessary since the point of the curly braces is to allow people to use K to visit them directly.

Oh, I wasn't aware that curly braces made a link that you could visit with a keybind! Sure, I'll change the PR.

@JL102
Copy link
Contributor Author

JL102 commented Jan 11, 2024

@kylechui Updated my branch. However, I see strange behavior in my own neovim instance when editing nvim-surround.txt.

If my cursor is over a letter in the word text, i.e. ... or [te[x]t object} with..., when I press K it opens the helptext for the word text (i.e. the same as when I enter :h text), and if my cursor is over a letter in the word object, i.e. ... or {text ob[j]ect} with..., when I press K it opens the helptext for the word object. I only get the correct helptext if I enter visual mode and highlight the whole word before pressing K.

Then, if I edit the helptext in my nvim install, i.e. .config/nvim/lazy/nvim-surround/doc/nvim-surround.txt and then open the Surround helptext via :h surround, when I press K with my cursor over {text-object} or {text-objects} it tells me E149: Sorry, no help for {text-objects}. The other helptext links work fine, though, i.e. hitting K when the cursor is over {motion} works fine.

I don't know what the deal is with this weird behavior.

@kylechui
Copy link
Owner

It seems like I might've been mistaken---perhaps it should be |text-objects| instead?

@JL102
Copy link
Contributor Author

JL102 commented Jan 15, 2024

It seems like I might've been mistaken---perhaps it should be |text-objects| instead?

Good catch, Neovim's docs do mention that links to other help docs need pipes around it. I get the same behavior regarding linking the individual words while I'm editing the text file, but if I then open :h surround the |text-object| link works for me.

@kylechui kylechui merged commit f0b0d43 into kylechui:main Jan 15, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants