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

Add <a-S> to split selections on boundaries #550

Closed
alexherbo2 opened this issue Jan 7, 2016 · 5 comments
Closed

Add <a-S> to split selections on boundaries #550

alexherbo2 opened this issue Jan 7, 2016 · 5 comments

Comments

@alexherbo2
Copy link
Contributor

No description provided.

@mawww
Copy link
Owner

mawww commented Feb 13, 2016

Whats the motivating use case for that feature ?

@alexherbo2
Copy link
Contributor Author

You could select a function end block, split selections on boundaries then ' and <a-&> to align.

It is used in scripts but works pretty well interactively.

@mawww
Copy link
Owner

mawww commented Feb 13, 2016

isnt that better handled by user defined text objects ?

@alexherbo2
Copy link
Contributor Author

alexherbo2 commented Feb 13, 2016

I don’t think these features are related. :o

Once you get your block selection, you split at the begin and end of selection then run command alignment. That way you can align end to its function, else to its if, etc.

It’s just a convenience to s \A|\Z after all.

@nochiel
Copy link
Contributor

nochiel commented Nov 11, 2017

+1 for this feature. Use case (with the key mapping @alexherbo2 is proposing):

Deleting parenthesis (or other matching pairs): |(foo)

mS\w+d would become m<a-S>d

Inserting markdown or simple matching pairs:

Given an arbitrary block of text, I often create a selection then want to surround it with * or `. Currently, this requires something like:3Wi*<esc>a* (where i*<esc>a* is mapped to a surround command that takes a parameter).

This would become: 3W<a-S>i*.

Is there already a simple way to do this?

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

3 participants