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[1]) > 0.5
                let g:timedif=abs(reltimefloat(reltime()) - g:last_word_count[1])
                let g:worddif=min([wordcount().words - g:last_word_count[0], 0])
                echom g:worddif
                let g:wpm=g:worddif / g:timedif * 60

                return string(g:wpm)
  • 3
    Welcome to Vi and Vim! This is an interesting question, but will likely take significant effort from someone to build, so don't hold your breath waiting for replies :)
    – D. Ben Knoble
    Nov 7 '21 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.