Add new lines using vertical select VIM -


suppose have following file content opened in vim:

function a1 {} function a2 {} function a3 {} function a4 {} function a5 {} function a6 {} function a7 {} 

i want expand functions in style:

function {  } 

for that, tried use vertical select (using ctrl + v):

function a1 {█ function a2 {█ function a3 {█ function a4 {█ function a5 {█ function a6 {█ function a7 {█ 

then pressed i. enter (in insert mode):

function a1 { } function a2 {} function a3 {} function a4 {} function a5 {} function a6 {} function a7 {} 

then pressed esc. expected expand blocks. nothing happened. why?

i know simple replace or macro save me. know there alternatives, want know why new line not added when using vertical select.

ctrl+v not "vertical select", "blockwise-visual". it's name implies, selecting "block" (rectangle) of text.

if insert line break inside selected block, disrupts comes below it. result there no longer meaningful way vim apply changes rest of block since isn't clear "the rest" anymore.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -