tags:

views:

103

answers:

2

Today unintentionally I typed something when the cursor was on very long line and this formatted my line, by braking it several lines of limited length. This line looks something like:

Foo("This is very long line (left '%s' right '%s) and it will never never never end", pNode->left.c_str(), pNode->right.c_str());

before formatting and after line this:

Foo("This is very long line (left '%s' right '%s) and it "
    "will never never never end", pNode->left.c_str(), 
    pNode->right.c_str());

What I pressed?

+2  A: 

Vgq (while having set tw=60) or

set wrap (maybe) ?

ldigas
A: 

to Idigas: I don't think so - the quotes (") confuses me. Does vim know that there is a string on the line so it should add extra quotes?

I tryed it and my vim did not put extra quotes to formated lines.

Lukas Cenovsky
Sorry Lukas, didn't see your answer there. Yes, you've got a point about them quotes. I'm not sure that vim would add them, but then again, I'm also not sure what filetype does that snip of code belong to (C ?). Mabe if the OP postes that extra bit of info ...
ldigas
Maybe the OP added them while writing his question, without thinking much of it ?
ldigas
That could be true. I just wanted to point this out that there might be a catch.
Lukas Cenovsky