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

Feature Request: New Text object #1

Open
kevintraver opened this issue Aug 25, 2023 · 3 comments
Open

Feature Request: New Text object #1

kevintraver opened this issue Aug 25, 2023 · 3 comments

Comments

@kevintraver
Copy link

kevintraver commented Aug 25, 2023

This is an awesome plugin!

It would be useful to have a new text object that is similar to the existing text objects, but a new version that is restricted or bounded by newlines at the same indentation level:

Example:

    def sample_function():
        print("hello world")

        print("some text")
        print("more *text")      <--- cursor here
        print("even more text")

        print("some more text")

This would select:

        print("some text")
        print("more text")
        print("even more text")
@kiyoon
Copy link
Owner

kiyoon commented Aug 25, 2023

Thanks for the feedback!

I think there are a lot of existing implementation for this one. For example

https://github.com/kana/vim-textobj-indent

This plugin should already have the feature you want.

@kiyoon
Copy link
Owner

kiyoon commented Aug 25, 2023

Actually, if I remember correctly, maybe this is a default vim textobject?

Can you try ap and ip?

@kevintraver
Copy link
Author

kevintraver commented Aug 25, 2023

Here's why ap and ip don't work:

    def sample_function()
        print("hello world")

        print("some text")
        print("more text")
        print("even more text")

        print("some more *text")      <--- cursor here
    def another_function()
        print "random text"

will select this:

        print("some more text")
    def another_function()
        print "random text"

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

No branches or pull requests

2 participants