LoginSignup
1
1

More than 5 years have passed since last update.

[Mac][Unity]Visual Studio Codeで保存する時にフォーマットする

Last updated at Posted at 2017-06-03

command+sでフォーマットして保存できるようにする

1.visual studio codeにマクロの拡張機能を追加する

左メニュ→一番下アイコン→拡張機能検索→macrosをインストールする
スクリーンショット 0029-06-03 16.21.36.png

2.マクロ定義する

Codeメニュー→基本設定→設定
スクリーンショット 0029-06-03 16.24.53.png

setting.json
{
    "macros": {
    "saveWithReformat": [
        "editor.action.format",//フォーマットキーマップ
        "workbench.action.files.saveAll"//保存キーマップ
    ]
    },
}

キーマップの参考:http://webdesign.vdlz.xyz/Editor/VSCode/Doc/Customization/Doc010_KeyBindingsForVisualStudioCode.html

3.ショートカット割り当て

Codeメニュー→基本設定→キーボードショートカット→高度なカスタマイズを行うkeybinding.json選択
スクリーンショット 0029-06-03 16.29.48.png

keybindings.json
[
  {
    "key": "cmd+s",
    "command": "macros.saveWithReformat"
  }
]

以下は、ゲームの宣伝です(すいません)

○落ちてくる物すべてタップ




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