LoginSignup
10
7

More than 1 year has passed since last update.

IdeaVimのvim-surroundチートシート

Last updated at Posted at 2018-01-24

対応コマンド

ys, cs, ds, S

文字を囲む

単語をシングルコーテーションで囲む
ysiw'
↑の「iw」の部分は、vimのテキストオブジェクト(t、f、$等)を指定できます
覚え方はyield surround xxxx かな?

行末までシングルコーテーションで囲む
ys$'

単語をタグで囲む
ysiw<html>

単語をカッコで囲む
ysiw) or ysiw}

カッコと単語の間に空白を入れて囲む
ysiw( or ysiw{

囲み文字を消す

シングルコーテーションを消す
ds'
覚え方は delete surround xxxx と思われる。

タグを消す
dst

囲み文字を変更する

コーテーションをタグに
cs'<html>
覚え方は change surround src dst です、多分。

タグをコーテーションに
cst'

シングルコーテーションをダブルコーテーションに
cs'"

選択状態の文字を囲む

シングルコーテーションで囲む
S'
覚え方はSelectedか。これだけ大文字。気合いで覚えよう。

タグで囲む
S<html>

10
7
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
7