I often press:
<Ctrl> V
to go into visual block mode and highlight a column- hit
<shift>-i
(to insert at the beginning of the line), type a few things (at this point, I see my changes on the first line, but not any others). - and then hit
<Esc>
to go back to normal mode.
After I hit <Esc>
, I see the stuff I inserted get put in each of the other lines.
What I would like is to visually see my changes on each line, as I type, rather than only on the first line. Is that possible?
Go into Visual Block, select a bunch of lines
Add some text – This is the part I'd like to be changed. I'd like for the spaces to be immediately visible on all lines, not just the first line.
Hit Escape – Now the spaces are added on every line. I'd like for this to happen sooner.
I know that I could have done what I did in this example with >>
. I chose a simplified example to illustrate the thing I'd like to change.
Thanks!
Best Answer
Try adding this to your vimrc:
Then press Ctrl-vI as usual, and then press F12. It will insert and show all lines changed for each keystroke.
Note: The script would be better if pressing F12 would go into insert mode, instead of requiring you to press I each time. Maybe the
startinsert
command in combination withvnoremap
could do this.