I want to insert return before one column of multiple lines, so I select the characters of this column with Ctrl+V in normal mode, then type I, Vim enters insert mode. After typing Enter key, and press key Esc, only one line is broken. Is there any way to perform this function? Thanks.
I want to insert return before one column of multiple lines, so I select
Share
To break lines just before a particular column, use
\%vsearch pattern atomthat matches in a given position with zero-width (see
:help /\%v). Thefollowing example command inserts new line character between the seventh and
the eighth columns.
This idea could be extended to use the number of the column where the cursor
is currently located.
The commands above does not require neither of those columns to be selected.
However, if it is easier for you to specify the split column with blockwise
Visual mode, use
\%Vzero-width atom matching inside the selected area (see:help \%V).