Repeating characters in VIM insert mode

Posted by Cthutu on Stack Overflow See other posts from Stack Overflow or by Cthutu
Published on 2011-02-19T23:10:21Z Indexed on 2011/02/19 23:25 UTC
Read the original article Hit count: 178

Filed under:

Is there a way of repeating a character while in Vim's insert mode? For example, say I would like to insert 80 dashes, in something like emacs I would type:

Ctrl+U 8 0 -

The only way I know how to do it in VIM is to exit normal mode for the repeat argument, then go back into insert mode to type the dash, then exit to insert the actual dashes, AND then go back into insert mode to carry on typing. The sequence is a really long:

<ESC> 8 0 a - <ESC> a

It would be nice not to switch in and out of modes.

Thanks

© Stack Overflow or respective owner

Related posts about vim