TIL

Today I Learned. 知ったこと、学んだことを書いていく

vim-operator-surround を入れてみた - VIm

github.com

テキストオブジェクトを指定の囲み文字で囲んだり、囲み文字を削除したりできるらしい。

インストール

dein.vimの場合

call dein#add('rhysd/vim-operator-surround')
call dein#add('kana/vim-operator-user')

設定

map <silent>sa <Plug>(operator-surround-append)
map <silent>sd <Plug>(operator-surround-delete)
map <silent>sr <Plug>(operator-surround-replace)
  • saiw(とするとそのワードの周りを(で囲む
  • sda(とすると(を削除する
  • sra"'とすると"'に変換する

詳しくは作者さんのサイトGitHubのページを見る。