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

Once selected a text object, expand the selection? #3

Closed
for-coursera opened this issue Feb 16, 2016 · 7 comments
Closed

Once selected a text object, expand the selection? #3

for-coursera opened this issue Feb 16, 2016 · 7 comments

Comments

@for-coursera
Copy link

Let's say I have a code block like this:

1.    def decr(d, a):
2.       r = {}
3.        for key, value in d.items():
4.           if key == a:
5.               value -= 1 #### my cursor is here
6.          r[key] = value
7.        return r

…and my cursor is on value -= 1 line. Once I press vaP, I get the if structure selected. But is it possible then to expand the selection somehow? Or, is it possible to pass some numeric argument before the selecting may be?

@tweekmonster
Copy link
Owner

We're talking about this in #1. I already have code that I'm going to push soon for adding counts to block operations, but I want to fix TravisCI first so I can get some tests in for this.

tweekmonster added a commit that referenced this issue Feb 16, 2016
Partially addresses #3
@tweekmonster
Copy link
Owner

Now you can use v2aP

@for-coursera
Copy link
Author

Now you can use v2aP

Thanks! Works like a charm. And any thoughts on selection's expansion may be? :) Or do we close this issue?

@tweekmonster
Copy link
Owner

What do you mean by expansion? There's a discussion about block motions in #1.

@for-coursera
Copy link
Author

What do you mean by expansion?

Something like that probably -- but for indented structures.

E.g., as for the code shown above, if my cursor is at line 5, and I press vaP, the if block gets selected, right? But what if add an additional shortcut, pressing which after the selection would expand this particular selection further? Press it once – and the for block gets selected; press it twice – and then the whole function is selected?

@tweekmonster
Copy link
Owner

Hmm, I think this is already covered if you press vaPaPaP. It's not exactly streamlined, but gets the job done. And a quick glance at their readme looks like you could define aP in its region config.

@for-coursera
Copy link
Author

I think this is already covered if you press vaPaPaP

Oh, thanks for pointing :). Somehow I was too slow just to think of it :).

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