neosnippet.vim でヤンクした HTML を Slim で展開する

これの Slim 版。

[vimrc]

" Html2Slim({slim})
" => {html}
function! Html2Slim(html)
    if !executable("html2slim")
        return ""
    endif
    let input  = tempname()
    call writefile(split(a:html, "\n"), input)
    let output = tempname()
    call system(printf("html2slim %s %s", input, output)
    return join(readfile(output), "\n")
endfunction

[slim.snip]

snippet html2slim
options word
    `Html2Slim(getreg(v:register))`