Is there a way to get insert mode emacs style meta counts in neovim (which has support for the meta key)?

Such that, for instance, <m-3>- produces 3 hyphens.

PS. I mean is it possible to produce the exact same behaviour. In this case, <m-3>- is better than <esc>3a-<esc>a.

1 Answer 1


Yep. {count}i{text}<esc>.

For example: 80i-<esc> will insert 80 equal signs. Great as a markdown horizontal rule.

And mappable in your ~/.vimrc

nnoremap <Leader>hr 80i-<esc>


:help insert

  • 3
    I knew that i took a count, but it never occurred to me that I could actually use it for something useful. Thanks! It should be noted that this is repeatable using ., in which case, it may be better to use 80a-<esc> to keep the cursor at the end of the inserted text.
    – Tommy A
    May 17, 2016 at 15:03
  • Nice. I like a even more! I almost always want my cursor at the end a change (like every other non-vim-editor).
    – ddrscott
    May 17, 2016 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.