sil update let [s:lhs,s:rhs] = [{'|':'bar'}, {'|':'bar', "'":"''"}] for ord in range(33,61)+range(63,90)+range(92,126) let char = nr2char(ord) let [l,r] = [get(s:lhs, char, char), get(s:rhs, char, char)] exe printf("nnore :echo 'M-%s PRESSED'", l, r) exe printf("nnore :let g:lastmap = '%s'", l, r) endfor for ord in range(33,61)+range(63,90)+range(92,126) let char = nr2char(ord) sil call feedkeys("\\".char, 'Tx') if get(g:, 'lastmap') != get(s:lhs, char, char) echom 'Broken' '' endif endfor if &mod | sil earlier 1f | endif " to test: " 1. paste this file into, for example, /tmp/meta_test.vim and open /tmp/meta_test.vim in vim " 2. :source % " to source the file and run tests " 3. :messages " to show the errors from the tests " 4. press Meta a or any other meta sequence to test " - it will print "M-a" (or whatever) to the cmdline