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

line text object #8903

Closed
hirschenberger opened this issue Nov 24, 2023 · 3 comments
Closed

line text object #8903

hirschenberger opened this issue Nov 24, 2023 · 3 comments
Labels
C-enhancement Category: Improvements

Comments

@hirschenberger
Copy link
Contributor

hirschenberger commented Nov 24, 2023

We have all kinds of obscure text objects like paragraphs, functions, arguments... but it seems that a line textobject is a natural and useful extension.

Assumed that l is the letter for line (which is still available), you could do things like mild to clear a line, mald to delete a line, milms} to put brackets around the current line.

I know all of this can be done with other key-combos, but they all seem like hacks or workarounds and are not as intuitive.

e.g. do clear a line: xdO<esc>, xvhd or x_d.

@hirschenberger hirschenberger added the C-enhancement Category: Improvements label Nov 24, 2023
@pascalkuthe
Copy link
Member

duplicate of #4234, both X and X_ already work and are easy enough to use.

Note that we also don't have a formal RFC process (#8853 is an experiment and something like this is only intended major design changes not minor keymap changes)

@pascalkuthe pascalkuthe closed this as not planned Won't fix, can't repro, duplicate, stale Nov 24, 2023
@hirschenberger
Copy link
Contributor Author

So as #4234 is an open issue, is that a thing that would be accepted as a PR? Then I'd give it a try.

@the-mikedavis
Copy link
Member

It seems unnecessary to me to have this re-implemented as a text-object: it's already implemented as extend_to_line_bounds or ["extend_to_line_bounds", "trim_selections"], or whatever the equivalent keys are for the ]/[ parts (https://github.com/Delapouite/kakoune-text-objects/blob/da9a268c3f239e40e0ca4665faa17f709563795b/text-objects.kak#L44-L62 in kakoune). Rather I'd like to see it be possible to add or change text-object bindings which are currently hardcoded in select_textobject_inner/select_textobject_around.

That isn't as straightforward as it seems though (like in #4287) since the fall-through behavior for "whatever character is typed next" isn't currently mappable.

@hirschenberger hirschenberger changed the title RFC: line text object line text object Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

3 participants