4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Sublime Text 2 で trailing space に色をつける

Posted at

Git にコミットする時に文句を言われたりする例のあれ。保存時に自動で消す設定もありますが、何となく気持ち悪いです。
(ちなみに "trim_trailing_white_space_on_save": true です。)

そこで TrailingSpaces plugin をインストール。Package Manager でインストールできます。

色をつける

Settings - User で以下のようにすれば、trailing space に色がつきます。

{
  "highlight_trailing_spaces_color_name": "invalid"
}

一気に消す

Cmd+Chift+P で del とか打つと出てくる Trailing Spaces: Delete Trailing Spaces コマンドを実行するだけです。

キーに割り当てたい場合、例えば Ctrl+Shift+t なら Keybindings - User で以下のような感じです。

[
  {
    "keys": ["ctrl+shift+t"],
    "command": "delete_trailing_spaces"
  }
]

参考

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?