LoginSignup
12
7

More than 5 years have passed since last update.

word をアンダースコアで区切る

Last updated at Posted at 2014-07-25

Ruby などの snake case を多用する言語でプラグラムを書いていると、foo_bar_bazfoo だけ書き換えたいとき、cw して全部消えてしまい、うわあ!となることはありませんか?

もちろん ct_ とすればいいのですが、1 タイプ増えてしまうし cw の押しやすさにはかないません。そもそも _ で区切っているのは単語なので、word と言ってもいい気がします。

そこで _ を区切り文字に含めるには以下のようにします。区切り文字に含めるというより、_ を単語を構成する文字から除外する感じですね。

set iskeyword-=_

とは言え、変数やメソッド名丸ごと書き換えたい時もあるので、微妙といえば微妙です・・・。

12
7
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
12
7