Vim の操作を幼女に音声支援させる方法


ほら、Editor 使っているとさ幼女の声ききたいじゃん。そのほうが作業も捗るからね。
動画: http://www.youtube.com/watch?v=DFuEJpNTcA8

以下設定方法

.vimrc
" function
function! PlaySE(name)
    silent! exec '!afplay ~/Dropbox/vim/sound/' . a:name . '.wav &'
endfunction

" 補完を閉じる
autocmd CompleteDone * call PlaySE("shift")

" バッファ移動
autocmd BufEnter * call PlaySE("switch")

" 入力
autocmd InsertCharPre * call PlaySE("input")

" 保存
autocmd BufWrite * call PlaySE("save")

" インサートモード IN / OUT
autocmd InsertEnter * call PlaySE("in")
autocmd InsertLeave * call PlaySE("out")

ランダムでの設定

.vimrc
function! s:Rand(max)
redir @n
ruby << EOF
    rmax = VIM::evaluate("a:max")
    rmax = nil if rmax == ""
    printf rand(rmax).to_s
EOF
redir END

let @n = strpart(@n, 1, strlen(@n) - 1)
return @b
endfunction


" Random Play
function! RandPlaySE(name)
    silent! exec '!afplay ~/Dropbox/vim/sound/d/' . a:name . '-' . s:Rand(2) . '.wav &'
endfunction