Closed JL102 closed 8 months ago
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.
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.
@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.
It seems like I might've been mistaken---perhaps it should be |text-objects|
instead?
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.
Re: discussion https://github.com/kylechui/nvim-surround/discussions/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 ona
andi
. But it would feel weird to give the suggestion for:h text-objects
without mentioning:h motion
.