VS Codeのショートカットは、基本的に Ctrl(Windows)⇔ Cmd(Mac) の置き換えで対応できます。しかし、一部のショートカットはOS間で全く異なるキー配置になっており、両方のOSを使う人にとっては混乱の原因になります。

また、Cursor等のVS Code派生エディタでは、デフォルトショートカットが上書きされている場合があり、明示的にkeybindings.jsonで設定しておかないと期待通りに動作しないことがあります。

この記事では、以下の内容を解説します。

  • OS間で異なるショートカットの比較と統一案
  • デフォルトにはないが便利なショートカット(ケース変換など)
  • Cursor等の派生エディタ向けの設定
  • コピペで使えるkeybindings.json(Mac版/Windows版)

    OS間で異なるショートカット一覧

    統一が必要なショートカット

    以下は、Windows とMacでデフォルトのキー配置が異なるショートカットです。

    機能 Windows(デフォルト) Mac(デフォルト) 問題点
    置換 Ctrl + H Option + Cmd + F Macだけ独自。他アプリと統一したい
    行を下にコピー Shift + Alt + ↓ Shift + Option + ↓ 統一されているが、派生エディタで変わる場合あり
    エディタを右に分割 Ctrl + \ Cmd + \ 覚えにくいので変更推奨

    統一化の推奨設定

    機能 統一ショートカット 理由
    置換 Ctrl/Cmd + H Chrome、Word等と同じ。業界標準
    行を下にコピー Alt/Option + Ctrl/Cmd + ↓ 直感的で覚えやすい
    エディタを右に分割 Alt/Option + Ctrl/Cmd + 2 数字で分割数を表現

    デフォルトにない便利なショートカット

    VS Codeには機能としては存在するが、デフォルトでショートカットが割り当てられていないものがあります。以下は登録しておくと便利な機能です。

    ケース変換(テキスト変換)

    変数名やクラス名の命名規則変換に便利です。

    機能 コマンドID 推奨ショートカット
    小文字に変換 editor.action.transformToLowercase Alt + Ctrl/Cmd + L
    大文字に変換 editor.action.transformToUppercase Alt + Ctrl/Cmd + U
    タイトルケース editor.action.transformToTitlecase Ctrl/Cmd + Alt + CT
    ケバブケース editor.action.transformToKebabcase Ctrl/Cmd + Alt + CK
    キャメルケース editor.action.transformToCamelcase Ctrl/Cmd + Alt + CC
    スネークケース editor.action.transformToSnakecase Ctrl/Cmd + Alt + CS
    パスカルケース editor.action.transformToPascalcase Ctrl/Cmd + Alt + CP

    ショートカット設計のポイント:

    • Ctrl/Cmd + Alt + C を「Case変換モード」の起点とする
    • 2段階ショートカット(コードキー)で各変換を呼び出し
    • 頭文字で覚えやすい(K=Kebab, C=Camel, S=Snake, P=Pascal)

    その他の便利なショートカット

    機能 コマンドID 推奨ショートカット
    エディタ履歴をクリア workbench.action.clearEditorHistory Shift + Ctrl/Cmd + R

    Cursor等の派生エディタ向けの注意点

    CursorはVS Codeをベースにした派生エディタですが、独自のショートカットが追加されているため、VS Codeのデフォルトショートカットが上書きされている場合があります。

    keybindings.jsonを明示的に設定すべき理由

    1. 派生エディタ独自のショートカットとの競合を防ぐ
    2. VS Codeと同じ操作感を維持する
    3. 設定ファイルを共有すれば、どの環境でも同じ操作ができる

    特に注意が必要なショートカット

    機能 問題 対策
    Tab補完 AI補完機能と競合する場合がある when条件を明示的に設定
    Emmet展開 優先度が下がる場合がある keybindings.jsonで明示
    インライン補完 Copilot等と競合 条件付きで設定

    Emmetアクションの統一

    EmmetアクションはMac/Windowsでデフォルトのショートカットが大きく異なります。以下の体系で統一することを推奨します。

    統一ルール

    • 基本形: Alt + Ctrl/Cmd + キー
    • 拡張形(Shift付き): Shift + Alt + Ctrl/Cmd + キー

    推奨Emmetショートカット一覧

    アクション Mac Windows 覚え方
    Go to Matching Pair(タグ間移動) Alt + Cmd + → Alt + Ctrl + → 矢印で移動
    Balance(選択拡張) Alt + Cmd + A Alt + Ctrl + A A = All選択系
    Wrap with Abbreviation(タグで囲む) Shift + Alt + Cmd + A Shift + Alt + Ctrl + A Shift付きで拡張
    Remove Tag(タグ削除) Alt + Cmd + T Alt + Ctrl + T T = Tag
    Update Tag(タグ更新) Shift + Alt + Cmd + T Shift + Alt + Ctrl + T Shift付きで拡張
    Merge Lines(行結合) Alt + Cmd + F Alt + Ctrl + F F = Format系
    Update Image Size(画像サイズ取得) Alt + Cmd + I Alt + Ctrl + I I = Image
    Evaluate Math(四則演算) Alt + Cmd + Y Alt + Ctrl + Y Y = 演算(独自)

    keybindings.json 設定

    設定ファイルの開き方

    1. コマンドパレットを開く(Shift + Ctrl/Cmd + P
    2. Preferences: Open Keyboard Shortcuts (JSON) を検索して選択
    3. 以下の設定を貼り付け

    Mac版 keybindings.json

    [
      // ========================================
      // Tab補完の優先度設定
      // ========================================
      {
        "key": "tab",
        "command": "tab",
        "when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus"
      },
      {
        "key": "shift+space",
        "command": "tab",
        "when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus"
      },
      {
        "key": "tab",
        "command": "editor.emmet.action.expandAbbreviation",
        "when": "config.emmet.triggerExpansionOnTab && editorTextFocus && !editorReadonly && !editorTabMovesFocus"
      },
      {
        "key": "tab",
        "command": "inlineCompletion.commit",
        "when": "inlineCompletionVisible && !editorTabMovesFocus"
      },
      {
        "key": "tab",
        "command": "acceptSelectedSuggestion",
        "when": "suggestWidgetVisible && textInputFocus"
      },
    
      // ========================================
      // 基本操作(OS間統一)
      // ========================================
      {
        "key": "cmd+s",
        "command": "workbench.action.files.save",
        "when": "editorTextFocus"
      },
      {
        "key": "cmd+shift+s",
        "command": "workbench.action.files.saveAs",
        "when": "editorTextFocus"
      },
      {
        "key": "cmd+h",
        "command": "editor.action.startFindReplaceAction",
        "when": "editorFocus || editorIsOpen"
      },
      {
        "key": "cmd+]",
        "command": "editor.action.indentLines",
        "when": "editorTextFocus && !editorReadonly"
      },
      {
        "key": "cmd+[",
        "command": "editor.action.outdentLines",
        "when": "editorTextFocus && !editorReadonly"
      },
    
      // ========================================
      // エディタ操作
      // ========================================
      {
        "key": "alt+cmd+down",
        "command": "editor.action.copyLinesDownAction",
        "when": "editorTextFocus && !editorReadonly"
      },
      {
        "key": "alt+cmd+2",
        "command": "workbench.action.splitEditorRight"
      },
      {
        "key": "shift+cmd+r",
        "command": "workbench.action.clearEditorHistory",
        "when": "editorFocus"
      },
    
      // ========================================
      // Emmetアクション
      // ========================================
      {
        "key": "alt+cmd+right",
        "command": "editor.emmet.action.matchTag",
        "when": "editorTextFocus"
      },
      {
        "key": "alt+cmd+a",
        "command": "editor.emmet.action.balanceIn",
        "when": "editorTextFocus"
      },
      {
        "key": "shift+alt+cmd+a",
        "command": "editor.emmet.action.wrapWithAbbreviation",
        "when": "editorTextFocus"
      },
      {
        "key": "alt+cmd+t",
        "command": "editor.emmet.action.removeTag",
        "when": "editorTextFocus"
      },
      {
        "key": "shift+alt+cmd+t",
        "command": "editor.emmet.action.updateTag",
        "when": "editorTextFocus"
      },
      {
        "key": "alt+cmd+f",
        "command": "editor.emmet.action.mergeLines",
        "when": "editorTextFocus"
      },
      {
        "key": "alt+cmd+i",
        "command": "editor.emmet.action.updateImageSize",
        "when": "editorTextFocus"
      },
      {
        "key": "alt+cmd+y",
        "command": "editor.emmet.action.evaluateMathExpression",
        "when": "editorTextFocus"
      },
    
      // ========================================
      // ケース変換(デフォルトにないショートカット)
      // ========================================
      {
        "key": "alt+cmd+l",
        "command": "editor.action.transformToLowercase",
        "when": "editorTextFocus"
      },
      {
        "key": "alt+cmd+u",
        "command": "editor.action.transformToUppercase",
        "when": "editorTextFocus"
      },
      {
        "key": "cmd+alt+c cmd+alt+t",
        "command": "editor.action.transformToTitlecase",
        "when": "editorTextFocus"
      },
      {
        "key": "cmd+alt+c cmd+alt+k",
        "command": "editor.action.transformToKebabcase",
        "when": "editorTextFocus"
      },
      {
        "key": "cmd+alt+c cmd+alt+c",
        "command": "editor.action.transformToCamelcase",
        "when": "editorTextFocus"
      },
      {
        "key": "cmd+alt+c cmd+alt+s",
        "command": "editor.action.transformToSnakecase",
        "when": "editorTextFocus"
      },
      {
        "key": "cmd+alt+c cmd+alt+p",
        "command": "editor.action.transformToPascalcase",
        "when": "editorTextFocus"
      }
    ]
    

    Windows版 keybindings.json

    [
      // ========================================
      // Tab補完の優先度設定
      // ========================================
      {
        "key": "tab",
        "command": "tab",
        "when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus"
      },
      {
        "key": "shift+space",
        "command": "tab",
        "when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus"
      },
      {
        "key": "tab",
        "command": "editor.emmet.action.expandAbbreviation",
        "when": "config.emmet.triggerExpansionOnTab && editorTextFocus && !editorReadonly && !editorTabMovesFocus"
      },
      {
        "key": "tab",
        "command": "inlineCompletion.commit",
        "when": "inlineCompletionVisible && !editorTabMovesFocus"
      },
      {
        "key": "tab",
        "command": "acceptSelectedSuggestion",
        "when": "suggestWidgetVisible && textInputFocus"
      },
    
      // ========================================
      // 基本操作(OS間統一)
      // ========================================
      {
        "key": "ctrl+s",
        "command": "workbench.action.files.save",
        "when": "editorTextFocus"
      },
      {
        "key": "ctrl+shift+s",
        "command": "workbench.action.files.saveAs",
        "when": "editorTextFocus"
      },
      {
        "key": "ctrl+h",
        "command": "editor.action.startFindReplaceAction",
        "when": "editorFocus || editorIsOpen"
      },
      {
        "key": "ctrl+]",
        "command": "editor.action.indentLines",
        "when": "editorTextFocus && !editorReadonly"
      },
      {
        "key": "ctrl+[",
        "command": "editor.action.outdentLines",
        "when": "editorTextFocus && !editorReadonly"
      },
    
      // ========================================
      // エディタ操作
      // ========================================
      {
        "key": "alt+ctrl+down",
        "command": "editor.action.copyLinesDownAction",
        "when": "editorTextFocus && !editorReadonly"
      },
      {
        "key": "alt+ctrl+2",
        "command": "workbench.action.splitEditorRight"
      },
      {
        "key": "shift+ctrl+r",
        "command": "workbench.action.clearEditorHistory",
        "when": "editorFocus"
      },
    
      // ========================================
      // Emmetアクション
      // ========================================
      {
        "key": "alt+ctrl+right",
        "command": "editor.emmet.action.matchTag",
        "when": "editorTextFocus"
      },
      {
        "key": "alt+ctrl+a",
        "command": "editor.emmet.action.balanceIn",
        "when": "editorTextFocus"
      },
      {
        "key": "shift+alt+ctrl+a",
        "command": "editor.emmet.action.wrapWithAbbreviation",
        "when": "editorTextFocus"
      },
      {
        "key": "alt+ctrl+t",
        "command": "editor.emmet.action.removeTag",
        "when": "editorTextFocus"
      },
      {
        "key": "shift+alt+ctrl+t",
        "command": "editor.emmet.action.updateTag",
        "when": "editorTextFocus"
      },
      {
        "key": "alt+ctrl+f",
        "command": "editor.emmet.action.mergeLines",
        "when": "editorTextFocus"
      },
      {
        "key": "alt+ctrl+i",
        "command": "editor.emmet.action.updateImageSize",
        "when": "editorTextFocus"
      },
      {
        "key": "alt+ctrl+y",
        "command": "editor.emmet.action.evaluateMathExpression",
        "when": "editorTextFocus"
      },
    
      // ========================================
      // ケース変換(デフォルトにないショートカット)
      // ========================================
      {
        "key": "alt+ctrl+l",
        "command": "editor.action.transformToLowercase",
        "when": "editorTextFocus"
      },
      {
        "key": "alt+ctrl+u",
        "command": "editor.action.transformToUppercase",
        "when": "editorTextFocus"
      },
      {
        "key": "ctrl+alt+c ctrl+alt+t",
        "command": "editor.action.transformToTitlecase",
        "when": "editorTextFocus"
      },
      {
        "key": "ctrl+alt+c ctrl+alt+k",
        "command": "editor.action.transformToKebabcase",
        "when": "editorTextFocus"
      },
      {
        "key": "ctrl+alt+c ctrl+alt+c",
        "command": "editor.action.transformToCamelcase",
        "when": "editorTextFocus"
      },
      {
        "key": "ctrl+alt+c ctrl+alt+s",
        "command": "editor.action.transformToSnakecase",
        "when": "editorTextFocus"
      },
      {
        "key": "ctrl+alt+c ctrl+alt+p",
        "command": "editor.action.transformToPascalcase",
        "when": "editorTextFocus"
      }
    ]
    

    settings.jsonの併用設定

    keybindings.jsonと合わせて、settings.jsonにも以下の設定を追加することを推奨します。

    {
      "keyboard.dispatch": "keyCode",
      "emmet.triggerExpansionOnTab": true
    }
    
    設定 説明
    keyboard.dispatch Tabキーがアプリ切り替えになる問題を防ぐ
    emmet.triggerExpansionOnTab TabでEmmet展開を有効化

    ショートカット早見表

    基本操作

    機能 Mac Windows
    保存 Cmd + S Ctrl + S
    名前を付けて保存 Cmd + Shift + S Ctrl + Shift + S
    検索 Cmd + F Ctrl + F
    置換 Cmd + H Ctrl + H
    インデント Cmd + ] Ctrl + ]
    アウトデント Cmd + [ Ctrl + [

    エディタ操作

    機能 Mac Windows
    行を下にコピー Alt + Cmd + ↓ Alt + Ctrl + ↓
    エディタを右に分割 Alt + Cmd + 2 Alt + Ctrl + 2
    履歴クリア Shift + Cmd + R Shift + Ctrl + R

    Emmetアクション

    機能 Mac Windows
    タグ間移動 Alt + Cmd + → Alt + Ctrl + →
    Balance Alt + Cmd + A Alt + Ctrl + A
    Wrap Shift + Alt + Cmd + A Shift + Alt + Ctrl + A
    タグ削除 Alt + Cmd + T Alt + Ctrl + T
    タグ更新 Shift + Alt + Cmd + T Shift + Alt + Ctrl + T
    行結合 Alt + Cmd + F Alt + Ctrl + F
    画像サイズ取得 Alt + Cmd + I Alt + Ctrl + I
    四則演算 Alt + Cmd + Y Alt + Ctrl + Y

    ケース変換

    機能 Mac Windows
    小文字 Alt + Cmd + L Alt + Ctrl + L
    大文字 Alt + Cmd + U Alt + Ctrl + U
    タイトルケース Cmd + Alt + CT Ctrl + Alt + CT
    ケバブケース Cmd + Alt + CK Ctrl + Alt + CK
    キャメルケース Cmd + Alt + CC Ctrl + Alt + CC
    スネークケース Cmd + Alt + CS Ctrl + Alt + CS
    パスカルケース Cmd + Alt + CP Ctrl + Alt + CP

    まとめ

    VS Codeのショートカットを統一することで、以下のメリットがあります。

    1. Mac/Windows間での操作の一貫性
    2. 他のアプリとの操作感の統一(置換は Ctrl/Cmd + H
    3. Cursor等の派生エディタでも同じ操作が可能
    4. ケース変換などの便利機能を即座に使える

    keybindings.jsonファイルをDropbox等で管理しておけば、新しい環境でもすぐに同じ設定を適用できます。