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

Autoorient code on left border before pasting #12

Closed
mxsrc opened this issue Mar 31, 2016 · 3 comments
Closed

Autoorient code on left border before pasting #12

mxsrc opened this issue Mar 31, 2016 · 3 comments

Comments

@mxsrc
Copy link

mxsrc commented Mar 31, 2016

When pasting indented code, it would be great to orient it on the left border, such that the indentation that's not justified by just the codeblock being posted is removed.

Example:

int main() {
    if (condition) {
         printf("Hello World\n”);
    }
    return 0;
}

When selecting and pasting lines 2-4, it should be pasted as:

if (condition) {
    printf("Hello World\n”);
}
@javier-lopez
Copy link
Owner

Hello @mightyCelu,

That sounds nice, although I wouldn't integrate it in the default behavior, I like it more as an option. I'll see if I can come up with something during the weekend, pretty much still learning vim scripting =)

@mxsrc
Copy link
Author

mxsrc commented Apr 3, 2016

Hi @chilicuil, That's great! I also think it's better to make it opt-in. Otherwise it might the expected behavior for some users.

@javier-lopez
Copy link
Owner

Hello @mightyCelu

I've just added a barbarian implementation of the suggested feature, it's disabled by default, to test it add:

let g:sprunge_flush_left = 1

To your vimrc file, please let me know if you find any issue.

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