I started to use gvim, and I can\'t quite understand how the multiline edit works in gvim.
For example:
Original text:
asd asd asd asd asd;
asd a
My solution is to use these 2 mappings:
map n 0qq
map m q:'<,'>-1normal!@q
How to use them:
V12j
n
m
To make another edit you don't need to make the selection again. Just press
, make your edit and press
to apply.
How this works:
Exit the visual selection, go to the beginning of the line and start recording a macro.
q
Stop recording the macro.
:'<,'>-1normal!@q
From the start of the visual selection to the line before the end, play the macro on each line.
Go back down to the last line.
You can also just map the same key but for different modes:
vmap m 0qq
nmap m q:'<,'>-1normal!@q
Although this messes up your ability to make another edit. You'll have to re-select your lines.