6
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.

SublimeTextでタブとスペースを変換するショートカットを設定

Last updated at Posted at 2015-08-25

例えばmacなら、View > Indentation > Convert Indentation to Spaces (か、 Tabs) でタブとスペースを変換できるのですが、デフォでショートカットキーが設定されていないのでやや不便です。

そこで、メニューバー(左上)のSublime Text > Preferences > Key Bindings - User にて、以下の記述を追加するとラクに変換できるようになります。

Default(OSX).sublime-keymap
[
	// スペースをタブに変換
	{ "keys": ["ctrl+shift+x"], "command": "unexpand_tabs", "args": { "set_translate_tabs": false } },
	// タブをスペースに変換
	{ "keys": ["ctrl+shift+y"], "command": "expand_tabs", "args": { "set_translate_tabs": true } }
]
6
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
6
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?