operator-exec_command で caw.vim の operator を定義する

コメントアウトを行う operator が欲しかったんですが今使っている caw.vim ではそういう機能がなかったので operator-exec_command を利用して簡単につくってみました。

[ソース]

" コメントアウト
nmap <silent><expr> <Plug>(operator-caw-I-toggle)
\   operator#exec_command#mapexpr("normal `[%v`]\<Plug>(caw:I:toggle)")
" コメントアウトを外す
nmap <silent><expr> <Plug>(operator-caw-I-uncomment)
\   operator#exec_command#mapexpr("normal `[%v`]\<Plug>(caw:I:uncomment))")

nmap <Leader>c <Plug>(operator-caw-I-toggle)
nmap <Leader>C <Plug>(operator-caw-I-uncomment)


operator-exec_command 便利。