Skip to content

Add help tags for useful paragraphs on text-obj behavior in object/visual mode #13114

@bew

Description

@bew

Originally opened at neovim/neovim#25224

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.

I just discovered (by really not understanding what was going on..) the builtin behavior of repeated usage of text objects in visual mode as described in:

vim/runtime/doc/motion.txt

Lines 701 to 709 in d8b86c9

When used in Visual mode:
When start and end of the Visual area are the same (just after typing "v"):
One object is selected, the same as for using an operator.
When start and end of the Visual area are not the same:
For non-block objects the area is extended by one object or the white
space up to the next object, or both for the "a" objects. The
direction in which this happens depends on which side of the Visual
area the cursor is. For the block objects the block is extended one
level outwards.

This is very interesting behavior !!! 👌
However there is no way to simply refer to this paragraphs specifically.

other paragraph just above would also benefit from a help tag

vim/runtime/doc/motion.txt

Lines 686 to 699 in d8b86c9

When used after an operator:
For non-block objects:
For the "a" commands: The operator applies to the object and the white
space after the object. If there is no white space after the object
or when the cursor was in the white space before the object, the white
space before the object is included.
For the "inner" commands: If the cursor was on the object, the
operator applies to the object. If the cursor was on white space, the
operator applies to the white space.
For a block object:
The operator applies to the block where the cursor is in, or the block
on which the cursor is on one of the braces. For the "inner" commands
the surrounding braces are excluded. For the "a" commands, the braces
are included.

Describe the solution you'd like
I'd like to have the ability to refer to these 2 paragraphs specifically in my configs via 1+ help tags like v_text-objects or o_object-select

Describe alternatives you've considered
Refering to :h object-select or :h text-objects and mention it's about the paragraph(s) aaall the way below the list of builtin text objects...
But it's really not great for quick reference for such an important and potentially weird/unintuitive behavior..

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions