3

Suppose I have this piece of code

var t = "abc abc abc abc abc abc abc abc abc abc " +
        "abc abc abc abc abc abc abc abc abc";

I edit the first line but it exceeds the 80 columns in my editor

var t = "abc abc abc abc abc abc abc abc abc ABC ABC ABC abc" +
        "abc abc abc abc abc abc abc abc abc";

I don't like to have this in my code, so I need to format all lines

var t = "abc abc abc abc abc abc abc abc abc " +
        "ABC ABC ABC abc abc abc abc abc abc " +
        "abc abc abc abc";

There is possible to solve this using something like gq} or do you know a plugin that could help me?

1 Answers1

0

Until you find a plugin, you could record a macro qq, go to the right 80 times 80l, go to the end of the word before ge, append a " + <ENTER> "<Esc>, save the macro q.

Then you would join the following lines with J and delete unwanted " + " patterns.

You can play the macro again with @q.