I was practicing inserting text in multiple lines in vim, as given in this tutorial and this SO answer as well.
But this technique doesn't seem to work if the text to be inserted is something like "std::" or even "std:" The colon at the end seems to mess up something.
For a code like
cout << "Hello World" << endl;
cout << "Yo Yo!" << endl;
I take my cursor to the first line, at 'c', press, 'Ctrl+V' to enter Visual Block mode. Then I press 'j' to select the next line as well. Then I press 'I' to enter the special insert mode and then I enter the text I want to insert. Then I press 'Esc'
For any simple text such as 'try_',
it gives
try_cout << "Hello World" << endl;
try_cout << "Yo Yo!" << endl;
But if my text is something like 'std::'
it just gives
std::cout << "Hello World" << endl;
cout << "Yo Yo!" << endl;
It just ends up inserting text on the first line, leaving the others intact.
Please guide.