Assume the following file contents are opened in VIM:
function a1 {}
function a2 {}
function a3 {}
function a4 {}
function a5 {}
function a6 {}
function a7 {}
I want to expand all the functions in this style:
function an {
}
For this, I tried using vertical selection (using Ctrl+ V):
function a1 {█
function a2 {█
function a3 {█
function a4 {█
function a5 {█
function a6 {█
function a7 {█
Then I clicked I. Then Enter(in insert mode):
function a1 {
}
function a2 {}
function a3 {}
function a4 {}
function a5 {}
function a6 {}
function a7 {}
Then I clicked Esc. I expected to expand all the blocks. Nothing happened. Why?
I know that a simple replacement or macro will save me. I know there are alternatives, but I want to know why a new row was not added when using vertical selection.
source
share