Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Live preview visual block insert mode in vim?

Tags:

vim

In vim, I can hit Ctrl-v 4j shift-I hello ESC to prepend hello to 4 lines of text.

However, while I am typing hello, I only see myself typing on the first line. Is there any way to make it so I see myself typing on all four lines at once? (like in the equivalent mode in, say, Textmate, or emacs' cua-mode)

like image 544
Daniel Avatar asked Apr 28 '26 17:04

Daniel


1 Answers

There is no built-in way, for several reasons:

  • the parallel screen update would be slower (think of vi's heritage: slow terminal over low-bandwidth connection)
  • more difficult to implement (think of underlying autocmd events, potential popup menu, etc.)
  • inconsistency with other commands (such as 4a or 3o), which also only show the first edit, and duplicate the entered text after insert mode is left

There is probably a way to implement such in Vimscript (similar to what the mentioned multiple cursors plugins do), but it would probably be hard to get right under all circumstances.

like image 170
Ingo Karkat Avatar answered Apr 30 '26 10:04

Ingo Karkat