0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

VSCodeの設定、ショートカット、スニペット、拡張機能

Last updated at Posted at 2025-04-20

はじめに

私が知っているVSCodeの設定、ショートカット、スニペット、拡張機能をまとめました。設定ミスなどあるかもしれないですが、参考になれば幸いです。

↓こんな感じの見た目になります。
image.png

設定

以下のファイルに設定します。
C:\Users\ユーザ名\AppData\Roaming\Code\User\settings.json

settings.json
{
  // 注意
  // 元ファイルの内容をすべて上書きしないように
  // 「フォーマット」で検索してプロジェクト用に変更する

  // 拡張機能ーbackground
  "background.fullscreen": {
    "useFront": true,
    "style": {
      "background-position": "100% 100%",
      "background-size": "auto",
      "opacity": 0.3
    },
    // ローカルの画像へのfileパスはブラウザにドラッグアンドドロップで取得
    "images": [
      // "file:///C:/Users/${userHome}/AppData/Roaming/Code/User/background.jpg"
    ]
  },

  // 拡張機能ーVSCode Animations
  "vscode_custom_css.imports": [
    // "file:///c:/Users/${userHome}/.vscode/extensions/brandonkirbyson.vscode-animations-2.0.7/dist/updateHandler.js"
  ],
  "animations.Enabled": true,
  "animations.Scrolling": "Fade",
  "animations.CursorAnimation": true,

  // エディターの表示設定
  "editor.renderWhitespace": "none", // 空白文字の表示
  "editor.unicodeHighlight.ambiguousCharacters": true, // Unicode文字表示 Α A
  "editor.unicodeHighlight.includeComments": true, // コメント内でUnicode文字表示
  "editor.renderControlCharacters": true, // 制御文字を表示
  "editor.renderLineHighlight": "all", // カーソル行を強調
  "editor.minimap.enabled": false, // ミニマップ
  "editor.guides.bracketPairs": true, // 括弧の対応を線で表示
  "breadcrumbs.enabled": true, // パンくずリストを表示
  "editor.mouseWheelZoom": true, // Ctrl+マウスホイールでズーム
  "editor.cursorBlinking": "smooth", // カーソル点滅のアニメーション
  "editor.cursorSmoothCaretAnimation": "on", // カーソル移動のアニメーション
  "editor.cursorSurroundingLines": 0, // キー操作でスクロールする際の表示行数
  "editor.unicodeHighlight.invisibleCharacters": true, // 半角スペース以外の空白文字(目に見えない文字)にハイライト追加
  "editor.bracketPairColorization.enabled": true, // 括弧の対応を色付け(対応対象は以下)
  "editor.language.colorizedBracketPairs": [
    ["‘", "’"],
    ["“", "”"],
    ["(", ")"],
    ["(", ")"],
    ["⦅", "⦆"],
    ["[", "]"],
    ["[", "]"],
    ["〚", "〛"],
    ["〔", "〕"],
    ["{", "}"],
    ["{", "}"],
    ["〈", "〉"],
    ["《", "》"],
    ["「", "」"],
    ["『", "』"],
    ["【", "】"],
    ["〖", "〗"],
    ["〝", "〟"]
  ],

  // エディターの動作設定
  "editor.formatOnSave": true, // 保存時にフォーマット
  "editor.defaultFormatter": "esbenp.prettier-vscode", // デフォルトのフォーマッターをPrettierに設定
  "files.trimTrailingWhitespace": true, // 保存時に末尾の空白を削除
  "files.insertFinalNewline": true, // 保存時にファイル末尾に改行を挿入
  "files.trimFinalNewlines": true, // 保存時にファイル末尾の空行を削除
  "editor.formatOnPaste": true, // 貼り付け時にフォーマット
  "editor.formatOnType": true, // 入力時にフォーマット
  "editor.wordSeparators": "./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}`~?゠・,、;:!?.。‘’“”()⦅⦆[]〚〛〔〕{}〈〉《》「」『』【】〖〗〝〟", // 単語区切り文字
  // "editor.wordSegmenterLocales": ["ja"], // 日本語単語区切り
  "editor.copyWithSyntaxHighlighting": false, // 書式設定なしでテキストをコピー
  "editor.insertSpaces": false, // タブキーを押したときにスペースを挿入するか
  "editor.smoothScrolling": true, // エディタのスクロールを滑らかに
  "workbench.list.smoothScrolling": true, //VS Code のリストビュー(ファイルエクスプローラーなど)のスクロールを滑らかに
  "editor.roundedSelection": true, // 選択範囲の角を丸める
  "editor.find.autoFindInSelection": "multiline", // 検索時に範囲選択している場合、その範囲のみを検索

  // ワークベンチの設定
  "workbench.editor.wrapTabs": true, // タブを折り返し表示
  "workbench.editor.pinnedTabsOnSeparateRow": true, // ピン留めタブを別行に表示
  "workbench.editor.openPositioning": "last", // 新しいタブを右端に開く
  "accessibility.dimUnfocused": true, // フォーカスされていないエディタを暗くする

  // エクスプローラーの設定
  "explorer.compactFolders": false, // フォルダーをコンパクトに表示
  "explorer.autoReveal": true, // エディタでファイル選択時にエクスプローラーのフォーカスが移動する

  // ターミナルの設定
  "terminal.integrated.defaultProfile.windows": "Windows PowerShell", // デフォルトのシェルを設定
  "terminal.integrated.confirmOnExit": "always", // 終了時に確認
  "terminal.integrated.showExitAlert": true, // 終了時に確認
  "terminal.integrated.copyOnSelection": false, // 選択テキストをクリップボードにコピー
  "terminal.integrated.cursorStyle": "line", // カーソルスタイル
  "terminal.integrated.suggest.enabled": true, // サジェストが出る(windows powershellはサポートされていない)
  "terminal.integrated.commandsToSkipShell": [
    // ターミナルで入力したショートカットをターミナルで処理しないようにする配列
    "workbench.action.toggleSidebarVisibility" // サイドバーの表示/非表示
  ],

  // デバッグの設定
  "debug.inlineValues": "on", // デバッグ中に変数値を表示
  "debug.internalConsoleOptions": "openOnSessionStart", // デバッグコンソールを自動で開く
  "debug.openDebug": "openOnSessionStart", // デバッグビューを自動で開く

  // 検索の設定
  "search.showLineNumbers": true, // 検索結果に行数を表示

  // 言語固有の設定 フォーマット系
  "[csv]": {
    "editor.wordWrap": "off" // CSVファイルの行を折り返しなしで表示
  },
  "[log]": {
    "editor.wordWrap": "off" // LOGファイルの行を折り返しなしで表示
  },
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode" // JSONファイルのデフォルトフォーマッター
  },

  // UI
  // "workbench.iconTheme": "material-icon-theme", // アイコン
  // "workbench.productIconTheme": "jetbrains-idea-product-icon-theme", //製品アイコン
  "editor.fontFamily": "Courier New", //フォント
  // "workbench.activityBar.location": "hidden", // 左横バー
  "window.titleBarStyle": "custom", // 上のバー
  "window.customTitleBarVisibility": "never", // 上のバー
  // "window.menuBarVisibility": "toggle", // 上のバーのファイルとか
  "workbench.layoutControl.enabled": false, // 上のバーの右の奴
  "window.commandCenter": false, // 上のバーのコマンドセンター
  "workbench.statusBar.visible": true, // 下のバーの表示
  "window.dialogStyle": "custom", // ダイアログの見た目
  "window.title": " ", // ウィンドウタイトル

  // 
  "workbench.colorTheme": "Visual Studio Dark",
  "editor.tokenColorCustomizations": {
    //「Inspect Editor Tokens and Scopes」でscope,foreground調べられる
    "textMateRules": [
      {
        //テンプレ
        "scope": "",
        "settings": {
          "foreground": "#eefdf0"
        }
      },
      {
        "scope": "comment",
        "settings": {
          "fontStyle": "", // 筆記体を禁止
          "foreground": "#aaeb79cf"
        }
      },

      {
        "scope": "entity.name.function",
        "settings": {
          "foreground": "#00f700"
        }
      },
      {
        "scope": "entity.name.type",
        "settings": {
          "foreground": "#FFFF00"
        }
      },
      {
        "scope": "source.tsx",
        "settings": {
          "foreground": "#ffff00"
        }
      },
      {
        "scope": "storage.type",
        "settings": {
          "foreground": "#ffff00"
        }
      },
      {
        "scope": "variable",
        "settings": {
          "foreground": "#00ffd0"
        }
      },
      {
        "scope": "source.java",
        "settings": {
          "foreground": "#00ffd0"
        }
      },
      {
        "scope": "variable.parameter",
        "settings": {
          "foreground": "#00ffd0"
        }
      },
      {
        "scope": "variable.other.readwrite.tsx",
        "settings": {
          "foreground": "#00ffd0"
        }
      },
      {
        "scope": "variable.other.readwrite.tsx",
        "settings": {
          "foreground": "#00ffd0"
        }
      },
      {
        "scope": "variable.other.readwrite.alias.tsx",
        "settings": {
          "foreground": "#00ffd0"
        }
      },
      {
        "scope": "variable.other.object.tsx",
        "settings": {
          "foreground": "#00ffd0"
        }
      },
      {
        "scope": "variable.object.property.tsx",
        "settings": {
          "foreground": "#00ffd0"
        }
      },
      {
        "scope": "string",
        "settings": {
          "foreground": "#eefdf0"
        }
      },
      {
        "scope": "keyword",
        "settings": {
          "foreground": "#eefdf0"
        }
      },
      {
        "scope": "constant",
        "settings": {
          "foreground": "#eefdf0"
        }
      },
      {
        "scope": "punctuation.separator.comma.tsx",
        "settings": {
          "foreground": "#eefdf0"
        }
      },
      {
        "scope": "meta.objectliteral.tsx",
        "settings": {
          "foreground": "#eefdf0"
        }
      },
      {
        "scope": "meta.array.literal.tsx",
        "settings": {
          "foreground": "#eefdf0"
        }
      },
      {
        "scope": "meta.arrow.tsx",
        "settings": {
          "foreground": "#eefdf0"
        }
      },
      {
        "scope": "meta.var.expr.tsx",
        "settings": {
          "foreground": "#eefdf0"
        }
      },
      {
        "scope": "meta.block.tsx",
        "settings": {
          "foreground": "#eefdf0"
        }
      },
      {
        "scope": "meta.function.tsx",
        "settings": {
          "foreground": "#eefdf0"
        }
      },

      {
        "scope": "keyword.control",
        "settings": {
          "foreground": "#eefdf0"
        }
      },
      {
        "scope": "support.class",
        "settings": {
          "foreground": "#eefdf0"
        }
      },
      {
        "scope": "punctuation.terminator.statement.tsx",
        "settings": {
          "foreground": "#eefdf0"
        }
      },
      {
        "scope": "storage.modifier",
        "settings": {
          "foreground": "#eefdf0"
        }
      },
      {
        "scope": "variable.language",
        "settings": {
          "foreground": "#eefdf0"
        }
      },
      {
        "scope": "entity.other.attribute-name",
        "settings": {
          "foreground": "#eefdf0"
        }
      }
    ]
  },

  "workbench.colorCustomizations": {
    //--------------- サイドバー(左)--------------------
    "activityBarBadge.background": "#7FDBCA89", //通知バッジの背景
    "activityBarBadge.foreground": "#ffffff", //通知バッジの文字
    "activityBar.foreground": "#7FDBCA", //選択中(マークアイコン)
    "activityBar.background": "#011f38", // 背景
    "activityBar.activeBorder": "#7FDBCA", //選択中の左の線
    "sideBar.background": "#011f38", // 背景
    "sideBar.border": "#06eeff2d", // エディタとの区切り線
    "tree.indentGuidesStroke": "#7FDBCA", // ファイルのインデントのガイド線

    //--------------- タブ(上)--------------------
    "tab.activeBackground": "#5dbeff30", // アクティブなタブの背景
    "tab.activeForeground": "#7FDBCA", //アクティブタブの文字
    // "tab.activeBorder": "#7FDBCA", //アクティブなタブの下の線
    // "tab.activeBorderTop": "#7FDBCA", //アクティブなタブの上の線
    "editorGroupHeader.tabsBackground": "#011f38", //タブがないところ
    "tab.inactiveBackground": "#011f38", //非アクティブなタブの背景
    // "tab.inactiveForeground": "#ec2906", //非アクティブなタブの文字
    "tab.border": "#011f38", //タブの横の枠

    //------------------ ステータスバー(下) --------------------
    "statusBar.background": "#011f38", //背景
    "statusBar.foreground": "#7FDBCA", //文字
    "statusBar.debuggingBackground": "#011f38", //デバッグしているときの背景

    //------------------ターミナル --------------------
    // "terminal.foreground": "#7FDBCA", // ターミナルの文字

    //--------------- エディター内 --------------------
    "editor.background": "#011f38", //エディター背景
    "editorLineNumber.foreground": "#7FDBCA", //エディタの行番号
    "editorCursor.foreground": "#00f700", // 文字カーソル
    "editor.lineHighlightBorder": "#06eeff2d", // 行カーソルの枠
    "editor.lineHighlightBackground": "#002b35d1", // 行カーソルの背景

    "editor.findMatchHighlightBackground": "#b7024d3a", // 検索結果の背景
    "editor.findMatchHighlightBorder": "#fa026975", //検索結果の背景の周りの線
    "editor.findMatchBackground": "#b7024d77", // 検索結果の選択中の背景
    "editor.findMatchBorder": "#fa026975", //検索結果の選択中の背景の周りの線

    "editor.selectionBackground": "#005669", // 選択範囲の背景
    "editor.wordHighlightBackground": "#00566900", // 単語をクリックしたときの背景
    "editor.inactiveSelectionBackground": "#005669a8", // 選択範囲の背景(非アクティブ)
    "editor.selectionHighlightBackground": "#2d45fc42", // 選択範囲と同じ文字の背景
    "editor.selectionHighlightBorder": "#3b6bef", // 選択範囲と同じ文字の周りの線

    "editorGroup.border": "#06eeff2d", // グループの線
    "editorOverviewRuler.border": "#011f38", // スクロールバーの境界線

    "editorError.foreground": "#fc7777", // エラー波線
    "editorWarning.foreground": "#ffff00", // 警告波線
    "editorInfo.foreground": "#7FDBCA", // 情報波線

    "editorWhitespace.foreground": "#7fdbca94", // 半角スペース
    "editorUnicodeHighlight.border": "#fffb009f", //  全角スペースのハイライト枠

    //--------------- タイトルバー --------------------
    "titleBar.activeBackground": "#011f38", //上のバーの背景
    "titleBar.activeForeground": "#7FDBCA", //上のバーの文字
    "titleBar.inactiveBackground": "#011f38", //上のバーの背景(非アクティブ)
    "titleBar.inactiveForeground": "#7FDBCA", //上のバーの文字(非アクティブ)

    //--------------- スクロールバー --------------------
    "scrollbarSlider.background": "#7FDBCA", // スクロールバー
    "scrollbarSlider.activeBackground": "#06eeff2d", // スクロールバー持ったとき
    "scrollbarSlider.hoverBackground": "#06eeff2d", // スクロールバーフォーカスしたとき

    //--------------- 検索欄 --------------------
    "input.background": "#002b35d1", // 検索欄内背景
    "editorWidget.background": "#034b2dee", // 検索欄外背景
    "input.border": "#06eeff2d", // 検索欄枠
    "input.foreground": "#7FDBCA", // 検索欄文字

    //--------------- デバッグ コントロール --------------------
    "debugToolBar.background": "#011f38", //背景

    //--------------- メニューバー --------------------
    "menu.background": "#034b2dee", // 背景
    "menu.foreground": "#7FDBCA", // 文字
    "menu.selectionBackground": "#011f38", // 選択背景
    "menu.selectionForeground": "#7FDBCA", // 選択文字

    //--------------- ドロップダウン --------------------
    "dropdown.background": "#002b35d1", // 背景
    "dropdown.border": "#06eeff2d", // 
    "dropdown.foreground": "#7FDBCA", // 文字

    //--------------- 全体 --------------------
    "focusBorder": "#7FDBCA", // フォーカスの枠線
    "foreground": "#7FDBCA", // 文字
    "errorForeground": "#fc7777", // エラー文字
    "widget.shadow": "#7FDBCA", // 窓の枠の影
    "selection.background": "#3b6bef", // 選択した文字の背景

    "button.background": "#002b35d1", // ボタン背景
    "button.border": "#06eeff2d", // ボタン枠
    "button.foreground": "#7FDBCA", // ボタン文字
    // "button.hoverBackground": "#059e00", // フォーカスしたときのボタン背景

    "list.activeSelectionBackground": "#002b35d1", // アクティブで選択している背景
    "list.activeSelectionForeground": "#7FDBCA", // アクティブで選択している文字
    "list.inactiveSelectionBackground": "#002b35d1", // 非アクティブで選択している背景
    "list.inactiveSelectionForeground": "#7FDBCA", // 非アクティブで選択している文字

    "contrastActiveBorder": "#00f700", //アクティブ枠
    "panel.border": "#ff06062d", //パネル枠

    // "editorHoverWidget.background": "#ff0000", // エディタホバーしたときの背景
    "editorHoverWidget.border": "#00f700", // エディタホバーしたときの枠
    "list.hoverBackground": "#011f38" // サイドバーホバーしたときの背景
  },
  "terminal.integrated.profiles.windows": {
    "PowerShell": {
      "source": "PowerShell",
      "icon": "terminal-powershell"
    },
    "Command Prompt": {
      "path": [
        "${env:windir}\\Sysnative\\cmd.exe",
        "${env:windir}\\System32\\cmd.exe"
      ],
      "args": [],
      "icon": "terminal-cmd"
    },
    "Git Bash": {
      "source": "Git Bash"
    },
    "Windows PowerShell": {
      "path": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
    }
  }
}

ショートカット

以下のファイルに設定します。
C:\Users\ユーザ名\AppData\Roaming\Code\User\keybindings.json

keybindings.json
[
  //------------------ エディター--------------------
  // "ctrl+g" //行移動
  // "ctrl+enter" //行を挿入
  // "ctrl+d" //単語を選択する
  // "ctrl+bs" //カーソル位置より左側の単語を削除
  // "ctrl+Del" //カーソル位置より右側の単語を削除
  // "Alt+左クリック" //好きな場所にカーソルの追加
  // "ctrl+alt+↑↓" //カーソルの追加
  // "Alt+shift+ドラッグ" //矩形選択
  // "ctrl+." //クイックフィックスを開く
  // "ctrl+space" //候補の表示
  // "ctrl+f2" //一致するすべてを選択
  // "alt+gUp/PgDn" //カーソル位置はそのままでPageUp/PageDown
  // "alt+←→" //進む戻る

  // "ctrl+l+" //行選択
  // "alt+↑↓" //行移動
  // "alt+shift+↑↓" //行複製
  {
    "key": "ctrl+up", // カーソル飛び移動
    "command": "cursorMove",
    "args": {
      "to": "up",
      "by": "line",
      "value": 5
    },
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+down", // カーソル飛び移動
    "command": "cursorMove",
    "args": {
      "to": "down",
      "by": "line",
      "value": 5
    },
    "when": "editorTextFocus"
  },
  {
    "key": "alt+up", // カーソル飛び移動
    "command": "cursorMove",
    "args": {
      "to": "up",
      "by": "line",
      "value": 15
    },
    "when": "editorTextFocus"
  },
  {
    "key": "alt+down", // カーソル飛び移動
    "command": "cursorMove",
    "args": {
      "to": "down",
      "by": "line",
      "value": 15
    },
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+shift+up", // カーソル飛び移動(選択)
    "command": "cursorMove",
    "args": {
      "to": "up",
      "by": "line",
      "value": 5,
      "select": true
    },
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+shift+down", // カーソル飛び移動(選択)
    "command": "cursorMove",
    "args": {
      "to": "down",
      "by": "line",
      "value": 5,
      "select": true
    },
    "when": "editorTextFocus"
  },
  {
    "key": "alt+shift+up", // カーソル飛び移動(選択)
    "command": "cursorMove",
    "args": {
      "to": "up",
      "by": "line",
      "value": 15,
      "select": true
    },
    "when": "editorTextFocus"
  },
  {
    "key": "alt+shift+down", // カーソル飛び移動(選択)
    "command": "cursorMove",
    "args": {
      "to": "down",
      "by": "line",
      "value": 15,
      "select": true
    },
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+alt+up", // 矩形選択
    "command": "cursorColumnSelectUp",
    "when": "textInputFocus"
  },
  {
    "key": "ctrl+shift+alt+up", // 矩形選択デフォルト解除
    "command": "-cursorColumnSelectUp",
    "when": "textInputFocus"
  },
  {
    "key": "ctrl+alt+down", // 矩形選択
    "command": "cursorColumnSelectDown",
    "when": "textInputFocus"
  },
  {
    "key": "ctrl+shift+alt+down", // 矩形選択デフォルト解除
    "command": "-cursorColumnSelectDown",
    "when": "textInputFocus"
  },
  {
    "key": "ctrl+alt+left", // 矩形選択
    "command": "cursorColumnSelectLeft",
    "when": "textInputFocus"
  },
  {
    "key": "ctrl+shift+alt+left", // 矩形選択デフォルト解除
    "command": "-cursorColumnSelectLeft",
    "when": "textInputFocus"
  },
  {
    "key": "ctrl+alt+right", // 矩形選択
    "command": "cursorColumnSelectRight",
    "when": "textInputFocus"
  },
  {
    "key": "ctrl+shift+alt+right", // 矩形選択デフォルト解除
    "command": "-cursorColumnSelectRight",
    "when": "textInputFocus"
  },
  {
    "key": "ctrl+r", // ファイル内での置換
    "command": "editor.action.startFindReplaceAction",
    "when": "editorFocus"
  },
  {
    "key": "alt+a", // 括弧内の文字列を選択する
    "command": "editor.action.selectToBracket",
    "args": {
      //  true:括弧を含む
      // false:括弧を含まない
      "selectBrackets": false
    },
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+u", // 定義に移動
    "command": "editor.action.goToDeclaration",
    "when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
  },
  {
    "key": "ctrl+shift+u", // 次のエラーと警告に移動
    "command": "editor.action.marker.next",
    "when": "editorFocus"
  },
  {
    "key": "ctrl+e", // ファイルをエクスプローラーで開く
    "command": "revealFileInOS",
    "when": "editorFocus"
  },
  {
    "key": "ctrl+o", // アクティブなファイルと選択されたファイルを比較
    "command": "workbench.files.action.compareFileWith",
    "when": "activeEditor"
  },
  {
    "key": "ctrl+shift+o", // 未保存の変更箇所を確認
    "command": "workbench.files.action.compareWithSaved",
    "when": "activeEditor"
  },

  //------------------ タブ--------------------
  // "ctrl+shift+p" //コマンドパレットを開く
  // "ctrl+shit+t" //最近閉じたファイルを開く

  {
    "key": "ctrl+shift+w", // すべてのタブを閉じる
    "command": "workbench.action.closeAllEditors",
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+g", // 左タブに移動
    "command": "workbench.action.previousEditorInGroup",
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+h", // 右タブに移動
    "command": "workbench.action.nextEditorInGroup",
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+shift+g", // タブを左に移動
    "command": "workbench.action.moveEditorToPreviousGroup"
  },
  {
    "key": "ctrl+shift+h", // タブを右に移動
    "command": "workbench.action.moveEditorToNextGroup"
  },
  {
    "key": "ctrl+j", // 1つ目のエディタグループにフォーカス
    "command": "workbench.action.focusFirstEditorGroup"
  },
  {
    "key": "ctrl+l", // 2つ目のエディタグループにフォーカス
    "command": "workbench.action.focusSecondEditorGroup"
  },
  {
    "key": "ctrl+shift+j", // タブを左に移動
    "command": "workbench.action.moveEditorToPreviousGroup"
  },
  {
    "key": "ctrl+shift+l", // タブを右に移動
    "command": "workbench.action.moveEditorToNextGroup"
  },
  {
    "key": "ctrl+k", //ファイルを開く
    "command": "workbench.action.quickOpen"
  },

  {
    "key": "ctrl+\\", // ピン留めする
    "command": "workbench.action.pinEditor",
    "when": "editorFocus"
  },
  {
    "key": "ctrl+shift+oem_5", // ピン留めはずす
    "command": "workbench.action.unpinEditor",
    "when": "editorFocus"
  },
  // {
  //   "key": "ctrl+k ctrl+v", // 開いているファイルを分割
  //   "command": "workbench.action.splitEditor",
  //   "when": "editorFocus"
  // },
  // {
  //   "key": "ctrl+tab", // エディタグループ内でのアクティブエディタの切り替え
  //   "command": "workbench.action.nextEditorInGroup"
  // },
  // {
  //   "key": "ctrl+shift+tab",
  //   "command": "workbench.action.previousEditorInGroup"
  // },
  // {
  //   "key": "ctrl+j", // 分割エディタの作成 (左)
  //   "command": "workbench.action.splitEditorLeft",
  //   "when": "editorFocus"
  // },
  // {
  //   "key": "ctrl+l", // 分割エディタの作成 (右)
  //   "command": "workbench.action.splitEditorRight",
  //   "when": "editorFocus"
  // },

  //------------------ メニュー--------------------
  // "ctrl+shift+f" //検索
  // "Ctrl+shift+m" //問題ビュー
  // "Ctrl+q" //ターミナルなど一覧表示

  // {
  //   "key": "ctrl+i", // フォルダにフォーカス(ターミナルアクティブ時に効かない。shiftがあればターミナルはショートカットとして受け付ける模様)
  //   "command": "workbench.explorer.fileView.focus"
  // },

  {
    "key": "ctrl+shift+i", // フォルダにフォーカス
    "command": "workbench.explorer.fileView.focus"
  },
  {
    "key": "ctrl+alt+i",
    "command": "-workbench.panel.chat"
  },
  {
    "key": "ctrl+j", // 標準のパネル開閉のショートカットをoff
    "command": "-workbench.action.togglePanel"
  },

  {
    "key": "ctrl+i", // クイックオープンメニュー
    "command": "workbench.action.quickOpenView"
  },
  {
    "key": "ctrl+i", // クイックオープンメニュー操作
    "command": "workbench.action.quickOpenNavigateNext",
    "when": "inQuickOpen"
  },
  {
    "key": "ctrl+shift+i", // クイックオープンメニュー操作
    "command": "workbench.action.quickOpenNavigatePrevious",
    "when": "inQuickOpen"
  },
  {
    "key": "ctrl+p", // ターミナル
    "command": "workbench.action.terminal.focus"
  },
  {
    "key": "ctrl+shift+k", // ソース管理
    "command": "workbench.view.scm",
    "when": "!sideBarFocus || activeViewlet != 'workbench.view.scm'"
  },
  {
    "key": "ctrl+shift+r", // ワークスペース内での置換
    "command": "workbench.action.replaceInFiles"
  },
  {
    "key": "ctrl+b", // サイドバー開閉
    "command": "workbench.action.toggleSidebarVisibility"
  },
  {
    "key": "ctrl+m", // パネル開閉
    "command": "workbench.action.togglePanel"
  },

  //------------------ エクスプローラー--------------------
  {
    "key": "enter", // エクスプローラーがアクティブのままファイルを開く
    "command": "filesExplorer.openFilePreserveFocus",
    "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsFolder && !inputFocus"
  },
  {
    "key": "ctrl+enter", // ファイルを開く
    "command": "explorer.openAndPassFocus",
    "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsFolder && !inputFocus"
  },
  {
    "key": "ctrl+n", // ファイルを作成
    "command": "explorer.newFile",
    "when": "filesExplorerFocus"
  },
  {
    "key": "ctrl+shift+n", // フォルダを作成
    "command": "explorer.newFolder",
    "when": "filesExplorerFocus"
  },
  {
    "key": "ctrl+d", // フォルダをすべて折りたたむ
    "command": "workbench.files.action.collapseExplorerFolders",
    "when": "filesExplorerFocus"
  },
  {
    "key": "ctrl+o", // ファイルを開く
    "command": "workbench.action.files.openFile",
    "when": "filesExplorerFocus"
  },
  {
    "key": "ctrl+shift+o", // フォルダを開く (新しいウィンドウで)
    "command": "workbench.action.files.openFolder",
    "when": "filesExplorerFocus"
  },
  //------------------ ソース管理--------------------
  {
    "key": "enter", // ソースの管理がアクティブのままdiffを開く
    "command": "list.selectAndPreserveFocus",
    "when": "sideBarFocus && activeViewlet == 'workbench.view.scm'"
  },
  {
    "key": "ctrl+enter", // diffを開く
    "command": "list.select",
    "when": "sideBarFocus && activeViewlet == 'workbench.view.scm'"
  },
  //------------------ 検索--------------------
  //ctrl+↑↓  //カーソル移動
  {
    "key": "ctrl+d", // フォルダをすべて折りたたむ
    "command": "search.action.collapseSearchResults",
    "when": "workbench.view.search.active"
  },
  {
    "key": "ctrl+shift+d", // フォルダをすべて展開
    "command": "search.action.expandSearchResults",
    "when": "workbench.view.search.active"
  },

  //------------------ ターミナル(ターミナルの設定は別途している前提。作成したショートカットを呼ぶ設定をしている)--------------------
  // 親ディレクトリに移動 (cdUp)
  {
    "key": "alt+up",
    "command": "workbench.action.terminal.sendSequence",
    "args": {
      "text": "cd ..\u000D" // `cd ..\r`に相当
    },
    "when": "terminalFocus"
  },

  // `gf` を送信
  {
    "key": "alt+right",
    "command": "workbench.action.terminal.sendSequence",
    "args": {
      "text": "gf\u000D" // `gf\r`に相当
    },
    "when": "terminalFocus"
  },

  // `gb` を送信
  {
    "key": "alt+left",
    "command": "workbench.action.terminal.sendSequence",
    "args": {
      "text": "gb\u000D" // `gb\r`に相当
    },
    "when": "terminalFocus"
  },

  // `explorer .` を送信
  {
    "key": "ctrl+e",
    "command": "workbench.action.terminal.sendSequence",
    "args": {
      "text": "explorer .\u000D" // `explorer .\r`に相当
    },
    "when": "terminalFocus"
  },

  // `fav` を送信
  {
    "key": "ctrl+shift+o",
    "command": "workbench.action.terminal.sendSequence",
    "args": {
      "text": "fav\u000D"
    },
    "when": "terminalFocus"
  },

  // `Show-CustomCommandMenu` を送信
  {
    "key": "ctrl+o",
    "command": "workbench.action.terminal.sendSequence",
    "args": {
      "text": "Show-CustomCommandMenu\u000D"
    },
    "when": "terminalFocus"
  },

  // `cd ` とタブ補完を送信
  // \t はタブを意味します。
  {
    "key": "ctrl+u",
    "command": "workbench.action.terminal.sendSequence",
    "args": {
      "text": "cd \t"
    },
    "when": "terminalFocus"
  },

  // ターミナルで全てのテキストを選択
  {
    "key": "ctrl+a",
    "command": "workbench.action.terminal.selectAll",
    "when": "terminalFocus"
  },

  // 新しいターミナルを開く
  {
    "key": "ctrl+t",
    "command": "workbench.action.terminal.new",
    "when": "terminalFocus"
  },

  // 現在のターミナルペインを閉じる
  {
    "key": "ctrl+w",
    "command": "workbench.action.terminal.kill",
    "when": "terminalFocus"
  },

  // 次のターミナルタブに移動
  {
    "key": "ctrl+pgup",
    "command": "workbench.action.terminal.focusNext",
    "when": "terminalFocus"
  },
  {
    "key": "ctrl+g",
    "command": "workbench.action.terminal.focusPrevious",
    "when": "terminalFocus"
  },

  // 前のターミナルタブに移動
  {
    "key": "ctrl+pgdn",
    "command": "workbench.action.terminal.focusPrevious",
    "when": "terminalFocus"
  },
  {
    "key": "ctrl+h",
    "command": "workbench.action.terminal.focusNext",
    "when": "terminalFocus"
  },
  {
    "key": "ctrl+up", // 最大化
    "command": "workbench.action.toggleMaximizedPanel",
    "when": "terminalFocus && !panelMaximized"
  },
  {
    "key": "ctrl+down", //元のサイズに
    "command": "workbench.action.toggleMaximizedPanel",
    "when": "terminalFocus && panelMaximized"
  },
  {
    "key": "ctrl+down", // パネル開閉
    "command": "workbench.action.togglePanel",
    "when": "terminalFocus && !panelMaximized"
  },
  {
    "key": "ctrl+k", //最近使用したディレクトリに移動
    "command": "workbench.action.terminal.goToRecentDirectory",
    "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
  }
]

スニペット

以下のファイルに設定します。
C:\Users\ユーザ名\AppData\Roaming\Code\User\snippets\global.code-snippets

global.code-snippets
{
  "Console log": {
    "scope": "javascript,typescript,javascriptreact,typescriptreact",
    "prefix": "c",
        "body": [
      "console.log(\"$1\");"
    ],
    "description": "デバッグ"
  },
  "Console log all": {
    "scope": "javascript,typescript,javascriptreact,typescriptreact",
    "prefix": "co",
        "body": [
      "console.log(\"Name:\", \"$1\", \"Type:\", typeof $1, \"Value:\", $1);"
    ],
    "description": "変数名を詳しく知る用"
  },
  "System.out.println": {
    "scope": "java",
    "prefix": "s",
        "body": [
      "System.out.println(\"$1\");"
    ],
    "description": "デバッグ"
  },
  "System.out.println all": {
    "scope": "java",
    "prefix": "sy",
        "body": [
      "System.out.println(\"Name:\", \"$1\", \"Value:\", $1);"
    ],
    "description": "変数名を詳しく知る用"
  },
  "Print simple": {
    "scope": "python",
    "prefix": "p",
    "body": [
      "print(\"$1\")"
    ],
    "description": "デバッグ"
  },
  "Print variable with name": {
    "scope": "python",
    "prefix": "pr",
    "body": [
      "print(f\"Name: '$1', Type: {type($1)}, Value: {$1}\")"
    ],
    "description": "変数名を詳しく知る用"
  }

}

拡張機能

以下の拡張機能がお気に入りです。
https://marketplace.visualstudio.com/items?itemName=DavidLGoldberg.jumpy2
https://marketplace.visualstudio.com/items?itemName=sandcastle.vscode-open
https://marketplace.visualstudio.com/items?itemName=shalldie.background
https://marketplace.visualstudio.com/items?itemName=BrandonKirbyson.vscode-animations

その他

コマンドパレットで「case」と入力…文字のケースを変更できる

参考

https://zenn.dev/takuya/articles/4472285edbc132
https://zenn.dev/aose/articles/6188f61a6a2a25
https://code.visualstudio.com/api/references/theme-color
https://qiita.com/shopi_47/items/9916447e47848127b9d5
https://atmarkit.itmedia.co.jp/ait/articles/1709/15/news027.html

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?