As a concrete (although hyperbolic) example:
nnoremap , a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>a<esc>aX<esc>
This mapping will take a bit to actually type out an "X
" (at least in my underpowered Celeron. You may have to up the number of a<esc>
if you have a better CPU).
I have dozens of plugins installed, some that can make a huge amount of operations running possibly hundreds of lines of code, but all of them execute in a fraction of the time, so I was a bit surprised to find out that, out of all of these operations, changing modes is what made neovim chug.
Am I missing something? Is there a way to speed up this type of mapping?
:verbose
to see where they come fromInsertLeave
. Thanks a lot! I've submitted an edit to add your tip to the current answer.