LoginSignup
4
2

More than 1 year has passed since last update.

vim-surroundのysの覚え方 (プラグイン作者直伝)

Last updated at Posted at 2020-01-29

vim-surroundは便利なプラグインですが、のショートカット"ys"が覚えにくいので、覚え方を調べたところ、プラグイン作者がコメントしているのを発見しました。

まずは"ys"の意味から。2014年に上がったissueから、"ys"の意味は"You surround"だとわかりました。"ysiw"の意味は"You surround inner word"です。
issue→https://github.com/tpope/vim-surround/issues/128
作者tpopeさん自身も、これはあまりにも苦しい意味付けだと言うニュアンスのコメントをしています。

そして2019年にtpopeさんが以下のコメントをしました。
https://github.com/tpope/vim-surround/pull/228#issuecomment-524701368

Here's the real mnemonic: d, c, and y are the three most important Vim operations, and ds, cs, and ys are the three most important Surround operations. - tpope commented on Aug 26, 2019

意訳すると、「Vimの三大コマンドがd``c``yなら、Surroundの三大コマンドはds``cs``ysだ。って覚えられるよ!」って意味です。

以下、筆者より補足です。

d``c``yの覚え方も考慮した以下の覚え方を筆者は提案したいです。
「Vimの三大ヤンクコマンドd``c``yだ。そして、Surroundの三大コマンドはds``cs``ysだ。」

以上になります。

終わりに

私は現在、Web3のサービスの開発をしています。詳しくはこちらの記事をご覧下さい。
無料でイーサリアムが当たる、Web3時代の寄付サイトを作った話

4
2
0

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
4
2