Spaced Repetition Algorithm
vim-sm2 is the original SuperMemo-2 algorithm for spaced repetition, written in 100% pure VimL.
vim-sm2 is plugin manager agnostic. I recommend pathogen if you haven’t already got a preference.
vim-sm2 uses md5#md5 if you have it installed, but will get by without it if you don’t.
Give vim-sm2 a datafile and the interval multiplier (expressed in seconds) that you want to use. The original SM2 algorithm was based on day intervals (86400 seconds) which is good for knowledge based learning. Use hours (3600 seconds) for more frequent revision sessions which is better for skills.
let srs = SM2_SRS('data.srs', 3600)
Create new revisionable records:
let id = srs.new()
Optionally with your own id
call srs.new(some_id)
Collect the due records:
let due_ids = srs.due()
Iterate these, collect the user response (grade — a 1-5 response) and update the records:
for id in due_ids call show_challenge(id) let grade = input("How'd you go, sport? (1=dismal, 5=awesome): ") call srs.repetition(id, grade) endfor