I'm interested (mostly just for fun) in seeing my typing speed while working in Vim. I saw this post but this requires starting and stopping a function. I would prefer this to be a constantly updating value in the bottom bar of vim (similar to cursor position or something like that), perhaps taking and average of words written over the last 15 seconds and extrapolated to words per minute?
Not necessary, but if you could also provide some explanation of how your solution works that would be greatly appreciated! I'm still pretty new to the more interesting features of Vim and would love the opportunity to learn.
Thanks in advance! Any hints in the right direction would also be greatly appreciated!
EDIT: This is a somewhat working version of what i want. I believe the main issue with this is that the time updates too frequently.
function WPM() if abs(reltimefloat(reltime()) - g:last_word_count) > 0.5 let g:timedif=abs(reltimefloat(reltime()) - g:last_word_count) let g:worddif=min([wordcount().words - g:last_word_count, 0]) echom g:worddif let g:wpm=g:worddif / g:timedif * 60 return string(g:wpm) endif endfunction```