How can I format string concatenations ("abc" + "def") as I format paragraph in Vim? -


suppose have 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 first line exceeds 80 columns in 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 have in code, need format 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 possible solve using gq} or know plugin me?

until find plugin, record macro qq, go right 80 times 80l, go end of word before ge, append a " + <enter> "<esc>, save macro q.

then join following lines j , delete unwanted " + " patterns.

you can play macro again @q.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -