VSCodeの設定変更

vscode-vimのキー設定

前の設定はこっち。拡張機能は前回のときとほぼ変わってないと思う。

VSCode+Vim設定を晒す | python3.0系のなにか (enjoy-programming-python.com)

気づいたら結構変わってたので2024年の締めとしてさらしておく。

まだまだ整理したいけどいじってると時間が解けてくのでいったん区切り。

{
  //----------------------------
  // 見た目の設定
  //----------------------------
  "editor.rulers": [88], // 88文字にライン表示
  "editor.renderControlCharacters": true, // 制御文字表示
  "editor.minimap.enabled": false, // ミニマップ非表示
  "workbench.tree.indent": 12, // explorerのツリーを見やすく
  "diffEditor.renderSideBySide": false, // 差分エディタはインライン表示
  "editor.lineNumbers": "relative", // 数字+jkで移動するため相対行番号表示
  "editor.hover.enabled": false, // マウスでのHover非表示
  "terminal.integrated.showLinkHover": false, // terminalでhover非表示
  "editor.guides.bracketPairs": true, // カッコペア表示
  "editor.bracketPairColorization.enabled": true, // カッコ色付表示
  "markdown.preview.breaks": true, // マークダウンで普通に改行
  "zenMode.hideLineNumbers": false, // zenモードで行番号表示
  "files.exclude": { "**/__pycache__": true }, // pycacheは表示しない
  "workbench.activityBar.location": "top", // 横幅とるため、アクティビティバーを上に
  "workbench.iconTheme": "vscode-icons", //iconテーマ
  "workbench.startupEditor": "none", // 開始時空画面表示なし
  "workbench.editor.closeEmptyGroups": false, // 空グループは閉じない
  "workbench.editor.wrapTabs": true, // タブは折り返す
  //----------------------------
  // 機能の設定
  //----------------------------
  "editor.suggestSelection": "first", // サジェストは最初を選択
  "files.autoGuessEncoding": true, // エンコード推測
  "explorer.autoReveal": false, // エディタで選択時にエクスプローラで選択しない
  "explorer.confirmDragAndDrop": false, // Drag&Dropは確認なしで認める
  "files.trimFinalNewlines": true, // ファイル末尾の空行削除
  "files.trimTrailingWhitespace": true, // 行末尾の空白削除
  "workbench.list.openMode": "doubleClick", // シングルクリックではファイル開かない
  "cSpell.diagnosticLevel": "Hint", // スペルチェックはHint扱い
  "typescript.updateImportsOnFileMove.enabled": "always", //tsでファイル移動時import更新
  "files.watcherExclude": { "**/.venv/**": true }, // venv内は検索対象外
  "files.eol": "\n", // 改行は常にLF (Linuxに合わせる)
  "editor.formatOnSave": true, // 基本的に保存時にフォーマット(このファイル以外)
  "[settings.json]": { "editor.formatOnSave": false },
  "editor.formatOnPaste": true, // 貼り付け時もフォーマット
  "editor.formatOnType": false, // 入力時はフォーマットしない
  "terminal.integrated.defaultProfile.windows": "PowerShell", //wiターミナルはPowerShell
  "git.autofetch": true, // git fetch自動実行
  "editor.inlineSuggest.enabled": true,
  "editor.quickSuggestionsDelay": 100,
  "editor.accessibilitySupport": "off",
  //----------------------------
  // 言語別
  //----------------------------
  // python
  "[python]": {
    "editor.defaultFormatter": "ms-python.black-formatter",
    "editor.formatOnSave":true
  },
  "black-formatter.showNotifications": "onError",
  "flake8.args": [
    "--ignore=E203,E121,E123,E126,E226,E24,E704,W503,F401",
    "--max-line-length=88"
  ],
  // js, ts
  "javascript.updateImportsOnFileMove.enabled": "always",// ファイル移動時にimport更新
  "reactSnippets.settings.prettierEnabled": true,
  "[typescriptreact]": {
    "editor.tabSize": 2,
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript]": {
    "editor.tabSize": 2,
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnType": true // 保存のたびにホットリロード走るので
  },
  "[javascript]": {
    "editor.tabSize": 2,
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnType": true // 保存のたびにホットリロード走るので
  },
  // json
  "json.schemas": [],
  "[jsonc]": {
    "editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
  },
  // C#
  "omnisharp.useEditorFormattingSettings": false,
  "[csharp]": {
      "editor.defaultFormatter": "ms-dotnettools.csharp"
  },
  // c++
  "cmake.configureOnOpen": true,
  "cmake.generator": "Visual Studio 17 2022",
  "C_Cpp.clang_format_fallbackStyle": "LLVM",
  "cmake.configureArgs": [
    "-DVCPKG_TARGET_TRIPLET=x86-windows-static-md",
    "-LH",
    "-A Win32"
  ],
  // jupyter
  "jupyter.askForKernelRestart": false,
  "notebook.output.scrolling": true,
  "notebook.output.textLineLimit": 50,
  // html, xml
  "emmet.showAbbreviationSuggestions": false,
  "emmet.showExpandedAbbreviation": "never",
  "[xml]": {
    "editor.defaultFormatter": "redhat.vscode-xml"
  },

  // --------------------------------------------------------
  // code runner
  // --------------------------------------------------------
  "code-runner.runInTerminal": true, // terminalで実行
  // --- ファイル名から実行コマンド決める
  "code-runner.executorMapByGlob": {
    "test_*.py": "cd $workspaceRoot && $pythonPath -m pytest $fullFileName",
    "*.test.tsx": "npm test $fileName",
    "*.test.ts": "npm test $fileName"
  },
  // --- 拡張子から実行コマンドを決める
  "code-runner.executorMapByFileExtension": {
    ".md": "marp --html --preview $fullFileName"
  },

  // --- 言語ごと設定
  "code-runner.executorMap": {
    "javascript": "node",
    "cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
    "python": "$pythonPath -u $fullFileName",
    "go": "go run",
    "powershell": "powershell -ExecutionPolicy ByPass -File",
    "bat": "cmd /c",
    "shellscript": "bash",
    "csharp": "scriptcs",
    "rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",
    "vbscript": "cscript //Nologo",
    "typescript": "ts-node",
    "r": "Rscript",
    "haskell": "runhaskell",
    "autoit": "autoit3",
    "sass": "sass --style expanded",
    "scss": "scss --style expanded",
    "dart": "dart",
    "java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
    "groovy": "groovy",
		"ruby": "ruby",
  },

  //-----------------------------
  // vim設定
  //-----------------------------
  "vim.useSystemClipboard": true, // クリップボード共有
  "vim.hlsearch": true, // 検索単語ハイライト
  "vim.visualstar": true, // カーソル下を*で検索
  "vim.incsearch": true, //インクリメンタルサーチ
  "vim.leader": "<space>", // leaderはスペースキーに
  "vim.whichwrap": "h,l,<,>,[,]", // 左右移動で行またぐ
  "vim.foldfix": true, // 折りたたみ部分はまたいで移動
  // vim拡張設定
  "vim.sneak": true, // s+2文字で移動
  "vim.surround": true, // 囲い付け拡張
  // ノーマルモード時は日本語入力off
  "vim.autoSwitchInputMethod.obtainIMCmd": "C:\\Windows\\zenhan.exe 0",
  "vim.autoSwitchInputMethod.switchIMCmd": "C:\\Windows\\zenhan.exe {im}",
  "vim.autoSwitchInputMethod.defaultIM": "0",
  "vim.autoSwitchInputMethod.enable": true,
  //-----------------------------
  // vimキー変更
  //------------------------------
  "vim.normalModeKeyBindings": [
    // 現在行の行末までをターミナルで実行(READMEなどからそのまま実行時用)
    {
      "before": ["leader", "+"],
      "after": ["v", "$", "h", "leader", ":", "Esc"]
    },
    // 記憶したコマンドを実行
    {
      "before": ["leader", ";"],
      "after": [
        "o",
        "Esc",
        "\"",
        "c",
        "p",
        "leader",
        ":",
        ":",
        "k",
        "d",
        "d",
        "k"
      ]
    },
    // 現在行のコマンドでファイル実行して行消去
    {
      "before": ["leader", ":", "c"],
      "after": [
        "c",
        "c",
        "leader",
        "w",
        "^",
        "l",
        "l",
        "v",
        "$",
        "h",
        "leader",
        "f",
        "V",
        "_",
        "d",
        "k",
        "<Enter>"
      ]
    },
    // 現在行をターミナルで実行して行消去(入力→実行用)
    {
      "before": ["leader", ":", ":"],
      "after": ["^", "v", "$", "h", "leader", ":", "V", "_", "d"]
    },
  ],
  "vim.normalModeKeyBindingsNonRecursive": [
    // vim 設定変更
    { "before": ["Y"], "after": ["y", "$"] }, // Yはカーソル後ヤンクに変更 ★★★
    { "before": ["c", "c"], "after": ["g", "c", "c"] }, // c,cでコメントアウト★★★
    { "before": ["j"], "after": ["g", "j"] }, // 見た目の行で移動★★★
    { "before": ["k"], "after": ["g", "k"] }, // 見た目の行で移動★★★
    { "before": ["<Enter>"], "commands": ["editor.action.insertLineAfter"] }, // Enterで改行★★★
    { "before": ["Q"], "after": ["q", "a"] }, // マクロは使用頻度低いためShift必要に,aに記録
    { "before": ["@"], "after": ["@", "a"] }, // マクロ実行はaのマクロを実行
    { "before": ["leader", "Q"], "after": ["q"] }, // キー指定で記録と実行するときはleader使う
    { "before": ["leader", "@"], "after": ["@"] }, //
    { "before": ["ctrl+m"], "after": ["ctrl+a"] }, // インクリメント(実際はctrl+s) ★
    { "before": ["_", "w"], "after": ["\"_", "d","i", "w"] }, // ブラックホールをワンキーで
    { "before": ["_", "\""], "after": ["\"_", "d","i", "\""] }, // ブラックホールをワンキーで
    { "before": ["_", "("], "after": ["\"_", "d","i", "("] }, // ブラックホールをワンキーで
    { "before": ["_", ")"], "after": ["\"_", "d","i", "("] }, // ブラックホールをワンキーで

    // vs-code機能拡張
    { "before": ["q"], "commands": ["editor.action.showHover"] }, // ホバー表示 ★★★
    { "before": ["ctrl+h"], "commands": ["workbench.action.previousEditorInGroup"] }, // 次のファイルへ★★★
    { "before": ["ctrl+l"], "commands": ["workbench.action.nextEditorInGroup"] }, // 前のファイルへ★★★
    { "before": ["\\"], "after": [":", "%", "s", "/"] }, // ファイル内置換★★

    // カスタム
    { "before": ["K"], "after": ["f", ",", "a", "Enter", "Esc"] }, // コンマ位置で改行 ★★
    { "before": ["H"], "after": ["1", "0", "h"] }, // 10文字h
    { "before": ["L"], "after": ["1", "0", "l"] }, // 10文字l
    // { "before": ["R"], "after": ["$"] }, // 行末移動を押しやすい位置に
    { "before": ["["], "after": ["[", "m"] }, // メソッド単位で移動
    { "before": ["]"], "after": ["]", "m"] }, // メソッド単位で移動

    // g+ (m-画面中央移動,d-宣言位置★★,f-パス開く,i-戻ってimode,g-Topへ★★,p-win式貼り付け,
    //      ,u-小文字★,v-前の選択範囲★使うことあるため割当禁止, t-タブ移動はつぶす)
    { "before": ["g", "j"], "after": ["L"] }, // 画面上一番下へ移動 ★
    { "before": ["g", "k"], "after": ["H"] }, //  画面上一番上へ移動 ★
    { "before": ["g", "h"], "commands": ["workbench.action.focusLeftGroup"] }, // 隣へ
    { "before": ["g", "l"], "commands": ["workbench.action.focusRightGroup"] }, // 隣へ
    { "before": ["g", "s"], "commands": ["workbench.action.focusSideBar"] }, // サイドバーへ
    { "before": ["g", "t"], "commands": ["workbench.action.terminal.focus"] }, // ターミナルへ
    { "before": ["g", "n"], "after": ["M"] }, // 画面上真ん中へ移動
    { "before": ["g", "r"], "commands": ["editor.action.goToReferences"] }, // 参照に移動

    // spellchecker (vimに近いキーバインドだが、wは無視に変更)
    { "before": ["z", "g"], "commands": ["cSpell.addWordToUserDictionary"] },
    { "before": ["z", "G"], "commands": ["cSpell.addWordToFolderDictionary"] },
    { "before": ["z", "w"], "commands": ["cSpell.addIgnoreWord"] },
    { "before": ["z", "W"], "commands": ["cSpell.addIgnoreWordsToWorkspace"] },
    { "before": ["z", "="], "commands": ["cSpell.suggestSpellingCorrections"] },

    // カーソル位置変えずに表示位置変更を推しやすい位置に(zzはそのまま)
    { "before": ["z", "k"], "after": ["z", "t"] },
    { "before": ["z", "j"], "after": ["z", "b"] },

    // vim仕様からVSCode仕様に変更(undo,redo,jump,mark)
    { "before": ["u"], "commands": ["undo"] },
    { "before": ["ctrl+r"], "commands": ["redo"] },
    { "before": ["ctrl+o"], "commands": ["workbench.action.navigateBack"] },
    { "before": ["ctrl+i"], "commands": ["workbench.action.navigateForward"] },
    { "before": ["m"], "commands": ["bookmarks.toggle"] }, // ブックマーク切り替え★★
    { "before": ["M"], "commands": ["bookmarks.jumpToNext"] }, // 次のブックマークへ変更★★
    { "before": ["`"], "commands": ["bookmarks.list"] },

    // VSCode仕様からvim仕様へ(全選択,同じ単語マルチカーソル)
    { "before": ["ctrl+a"], "after": ["g", "g", "V", "G"] },
    { "before": ["ctrl+d"], "after": ["g", "b"] },

    // leader設定をアルファベット順に並べておく
    //{ "before": [ "leader", "a" ] => AI prefix (copilot)
    { "before": ["leader", "b"], "commands": ["workbench.action.tasks.build"] }, // ビルド(として登録したタスク実行)★★★
    //{ "before": [ "leader", "b" ], "commands": [ "workbench.action.debug.start" ] }, // デバッグ開始(python)
    { "before": ["leader", "c"], "commands": ["workbench.files.action.compareFileWith"] }, // ファイルを比較★
    { "before": ["leader", "d"], "commands": [
        "editor.action.revealDefinition",
        "workbench.action.moveEditorToNextGroup",
        "workbench.action.focusLeftGroup"
      ] }, // 定義を表示して右へ移動★★
    { "before": ["leader", "e"], "commands": ["editor.action.marker.nextInFiles"] }, // 次のエラーに移動 ★★★
    { "before": ["leader", "f"], "commands": ["search.action.openNewEditor"] }, // 全てから検索 ★★★
    //{ "before": [ "leader", "g" ] =>gitプレフィクス ★★★
    { "before": ["leader", "h"], "commands": ["workbench.files.action.showActiveFileInExplorer"] }, // このファイルをエクスプローラ上で表示 ★★
    { "before": ["leader", "i"], "commands": ["workbench.files.action.compareWithSaved"] }, // 保存済みと比較★★
    {
      "before": ["leader", "j"],
      "commands": [
        "workbench.action.focusPanel",
        "workbench.action.focusActiveEditorGroup",
        "workbench.action.files.saveAll",
        "workbench.action.terminal.scrollToBottom",
        {
          "command": "workbench.action.terminal.sendSequence",
          "args": { "text": "\u001b[A\n" }
        }
      ]
    },// 保存してから直前に実行したコマンドを再度実行 ★★★
    { "before": ["leader", "k"], "commands": ["workbench.action.quickchat.toggle"] }, // quick chat
    { "before": ["leader", "l"], "commands": ["workbench.files.action.showActiveFileInExplorer"] }, // このファイルをエクスプローラ上で表示 ★★
    { "before": ["leader", "m"], "commands": ["bookmarks.toggleLabeled"] }, // ラベル付きブックマーク
    { "before": ["leader", "n"], "commands": ["editor.action.rename"] }, // 変数名変更 ★★★
    { "before": ["leader", "o"], "commands": ["workbench.action.quickOpen"] }, // ファイルを開く ★★★
    { "before": ["leader", "p"], "after": ["b", "i", "p", "r", "i", "n", "t", "(", "f", "\"", "{", "Esc","l", "e", "i", "=", "}", "\"", ")", "Esc" ] }, // pythonのprintコード化
    // { "before": ["leader", "q"], =>囲み系"commands":["editor.action.marker.prevInFiles"] }, // 前のエラー
    { "before": ["leader", "r"], "commands": ["editor.action.goToReferences"] }, // 参照位置に移動 ★★★
    {
      "before": ["leader", "s"], // 保存実行 ★★★
      "commands": [
        "workbench.action.files.saveAll",
        "workbench.action.terminal.scrollToBottom",
        "code-runner.run"
      ]
    },
    { "before": ["leader", "t"], "commands": ["copyFilePath", "workbench.action.terminal.focus"] }, //ファイル名コピーしてターミナルへ移動
    { "before": ["leader", "u"], "commands": ["editor.toggleFold"] }, // 折り畳みの切替★
    { "before": ["leader","leader", "u"], "commands": ["editor.unfoldAll"] }, // すべて展開★
    //{ "before": [ "leader", "v" ] =>貼り付けprefix
    { "before": ["leader", "w"], "commands": ["workbench.action.files.save"] }, // 保存 ★★★
    { "before": ["leader", "W"], "commands": ["workbench.action.files.saveWithoutFormatting"] }, // フォーマットなし保存★
    { "before": ["leader", "leader", "w"], "commands": ["workbench.action.files.saveAll"] }, // すべて保存 ★★
    //{ "before": [ "leader", "x" ] =>表示prefix
    { "before": ["leader", "y"], "commands": ["revealFileInOS"] }, // エクスプローラで表示
    { "before": ["leader", "z"], "commands": [":q"] }, // 閉じる ★★
    { "before": ["leader", "leader", "z"], "commands": [":q!"] }, // 強制的に閉じる ★
    { "before": ["leader", "@"], "after": ["@"] }, // マクロ実行
    { "before": ["leader","leader" ,"@"], "after": ["q"] }, // マクロ記録
    //{ "before": [ "leader", ";" ] =>現在行をターミナルで実行(Recursive)
    //{ "before": [ "leader", ":" ] =>ターミナルコマンドprefix
    {
      "before": ["leader", "]"],
      "commands": [
        "workbench.action.moveEditorToNextGroup",
        "workbench.action.focusLeftGroup"
      ]
    }, //ファイルを隣のグループへ移す★
    {
      "before": ["leader", "["],
      "commands": [
        "workbench.action.moveEditorToPreviousGroup",
        "workbench.action.focusRightGroup"
      ]
    }, // ファイルを隣のグループへ移す★
    // --- restructuredText用 ---
    { "before": ["leader", "#"], "after": ["shift+o", "Esc", "8", "9",  "i", "#", "Esc", "y", "y", "j", "p"] },
    { "before": ["leader", "*"], "after": ["shift+o", "Esc", "8", "9",  "i", "*", "Esc", "y", "y", "j", "p"] },
    { "before": ["leader", "="], "after": ["o", "Esc", "8", "9",  "i", "=", "Esc"] },
    { "before": ["leader", "-"], "after": ["o", "Esc", "8", "9",  "i", "-", "Esc"] },
    // --- restructuredText用 ---

    { "before": ["leader", ","], "after": ["d", "i", "\""] }, // 引用符内を消去
    { "before": ["leader", "."], "commands": ["inlineChat.startWithCurrentLine"] }, // copilot
    { "before": ["leader", "/"], "commands": ["workbench.action.splitEditor"] }, // エディタ分割
    {
      "before": ["leader", "\\"],
      "commands": [
        "workbench.action.terminal.split",
        "workbench.action.focusActiveEditorGroup"
      ]
    }, //terminal分割
    { "before": ["leader", "\""], "after": ["v", "i", "w", "S", "\""] }, // 単語""囲み
    { "before": ["leader","(", "\""], "after": ["v", "i", "b", "S", "\""] },// ()内""囲み
    { "before": ["leader",")", "\""], "after": ["v", "i", "b", "S", "\""] },// ()内""囲み
    { "before": ["leader", "'"], "after": ["v", "i", "w", "S", "'"] }, // 単語''囲み
    { "before": ["leader","(", "'"], "after": ["v", "i", "b", "S", "'"] },// ()内''囲み
    { "before": ["leader",")", "'"], "after": ["v", "i", "b", "S", "'"] },// ()内''囲み
    // ------- a => AI アシスタント (copilot) ----------
    { "before": ["leader", "a", "g"], "commands": ["github.copilot.chat.generate"] }, // 生成
    { "before": ["leader", "a", "r"], "commands": ["github.copilot.chat.review"] }, // ファイルをチャットに追加
    { "before": ["leader", "a", "c"], "commands": ["github.copilot.chat.review.continueInChat"] }, // ディレクトリ
    { "before": ["leader", "a", "t"], "commands": ["github.copilot.chat.generateTests"] }, // テスト生成
    { "before": ["leader", "a", "d"], "commands": ["github.copilot.chat.generateDocs"] }, // doc生成
    { "before": ["leader", "a", "f"], "commands": ["github.copilot.chat.attachFile"] }, // ファイルをチャットに追加
    { "before": ["leader", "a", "i"], "commands": ["inlineChat.startWithCurrentLine"] }, // inlineチャット開始(leader+.でも同じ)
    { "before": ["leader", "a", "a"], "commands": ["workbench.action.quickchat.toggle"] }, // quickchat

    // ------- g => git プレフィクス ----------
    {
      "before": ["leader", "g", "a"],
      "commands": [
        "workbench.action.terminal.scrollToBottom",
        {
          // git add
          "command": "workbench.action.terminal.sendSequence",
          "args": {
            "text": "git add ${file} \n git status\n"
          }
        }
      ]
    },
    { "before": ["leader", "g", "b"], "commands": ["git.checkout"] }, // git checkout
    { "before": ["leader", "g", "c"], "commands": ["git.commit"] }, // git commit
    {
      "before": ["leader", "g", "d"],
      "commands": [
        "workbench.action.terminal.scrollToBottom",
        {
          // git diff
          "command": "workbench.action.terminal.sendSequence",
          "args": {
            "text": "git diff -- ${file}\n"
          }
        }
      ]
    },
    {
      "before": ["leader", "g", "e"],
      "commands": [
        {
          // git commit --amend
          "command": "workbench.action.terminal.sendSequence",
          "args": {
            "text": "git add ${file} \n git commit --amend --no-edit \n"
          }
        },
        "workbench.action.terminal.scrollToBottom"
      ]
    },
    {
      "before": ["leader", "g", "f"],
      "commands": [
        {
          // git add .
          "command": "workbench.action.terminal.sendSequence",
          "args": {
            "text": "git add . \n git status\n"
          }
        },
        "workbench.action.terminal.scrollToBottom"
      ]
    },
    {
      "before": ["leader", "g", "g"],
      "commands": ["git-graph.view"]
    }, // git-graph
    {
      "before": ["leader", "g", "l"],
      "commands": [
        "workbench.action.terminal.scrollToBottom",
        {
          // git log
          "command": "workbench.action.terminal.sendSequence",
          "args": { "text": "git log -- ${file}\n" }
        }
      ]
    },
    {
      "before": ["leader", "g", "r"],
      "commands": [
        "workbench.action.terminal.scrollToBottom",
        {
          // git reflog
          "command": "workbench.action.terminal.sendSequence",
          "args": { "text": "git reflog\n" }
        }
      ]
    },
    {
      "before": ["leader", "g", "s"],
      "commands": [
        "workbench.action.terminal.scrollToBottom",
        {
          // git status
          "command": "workbench.action.terminal.sendSequence",
          "args": { "text": "git status\n" }
        }
      ]
    },
    {
      "before": ["leader", "g", "w"],
      "commands": [
        "workbench.action.terminal.scrollToBottom",
        {
          // git stash
          "command": "workbench.action.terminal.sendSequence",
          "args": {
            "text": "git stash save \" ${fileBasenameNoExtension} editing\" \n"
          }
        }
      ]
    },
    {
      "before": ["leader", "g", "z"],
      "commands": [
        "workbench.action.terminal.scrollToBottom",
        {
          // ステージ取り消し
          "command": "workbench.action.terminal.sendSequence",
          "args": { "text": "git reset HEAD\n" }
        }
      ]
    },
    {
      "before": ["leader", "g", "u", "f"],
      "commands": [
        "workbench.action.terminal.scrollToBottom",
        {
          // ファイルを元に戻す
          "command": "workbench.action.terminal.sendSequence",
          "args": { "text": "git restore ${file} \n" }
        }
      ]
    },
    {
      "before": ["leader", "g", "u", "c"],
      "commands": [
        "workbench.action.terminal.scrollToBottom",
        {
          // 直前コミット取り消し
          "command": "workbench.action.terminal.sendSequence",
          "args": { "text": "git reset --soft HEAD^ \n" }
        }
      ]
    },

    // ---- q => 単語囲み
    { "before": ["leader", "q", "\""], "after": ["v", "i", "w", "S", "\""] },
    { "before": ["leader", "q", "'"], "after": ["v", "i", "w", "S", "'"] },
    { "before": ["leader", "q", "`"], "after": ["v", "i", "w", "S", "`"] },
    { "before": ["leader", "q", "{"], "after": ["v", "i", "w", "S", "{"] },
    { "before": ["leader", "q", "}"], "after": ["v", "i", "w", "S", "}"] },
    { "before": ["leader", "q", "["], "after": ["v", "i", "w", "S", "["] },
    { "before": ["leader", "q", "]"], "after": ["v", "i", "w", "S", "]"] },
    { "before": ["leader", "q", "("], "after": ["v", "i", "w", "S", "("] },
    { "before": ["leader", "q", ")"], "after": ["v", "i", "w", "S", ")"] },
    { "before": ["leader", "q", "<"], "after": ["v", "i", "w", "S", "<"] },
    { "before": ["leader", "q", ">"], "after": ["v", "i", "w", "S", ">"] },
    // ------- v => 特殊な貼り付け ----------
    // --- []{}()<>"'`内をレジスタ内の値に置き換える
    { "before": ["leader", "v", "["], "after": ["\"", "z", "d", "i", "[", "h", "p"] },
    { "before": ["leader", "v", "]"], "after": ["\"", "z", "d", "i", "[", "h", "p"] },
    { "before": ["leader", "v", "{"], "after": ["\"", "z", "d", "i", "{", "h", "p"] },
    { "before": ["leader", "v", "}"], "after": ["\"", "z", "d", "i", "{", "h", "p"] },
    { "before": ["leader", "v", "("], "after": ["\"", "z", "d", "i", "(", "h", "p"] },
    { "before": ["leader", "v", ")"], "after": ["\"", "z", "d", "i", "(", "h", "p"] },
    { "before": ["leader", "v", "b"], "after": ["\"", "z", "d", "i", "(", "h", "p"] },
    { "before": ["leader", "v", "B"], "after": ["\"", "z", "d", "i", "(", "h", "p"] },
    { "before": ["leader", "v", "<"], "after": ["\"", "z", "d", "i", "<", "h", "p"] },
    { "before": ["leader", "v", ">"], "after": ["\"", "z", "d", "i", "<", "h", "p"] },
    { "before": ["leader", "v", "t"], "after": ["\"", "z", "d", "i", "t", "h", "p"] },
    { "before": ["leader", "v", "T"], "after": ["\"", "z", "d", "i", "t", "h", "p"] },
    { "before": ["leader", "v", "\""], "after": ["\"", "z", "d", "i", "\"", "h", "p"] },
    { "before": ["leader", "v", "`"], "after": ["\"", "z", "d", "i", "`", "h", "p"] },
    { "before": ["leader", "v", "'"], "after": ["\"", "z", "d", "i", "'", "h", "p"] },
    // --- 単語単位,行頭行末までを置き換える
    { "before": ["leader", "v", "w"], "after": ["\"", "z", "d", "i", "w", "h", "p"] },
    { "before": ["leader", "v", "e"], "after": ["\"", "z", "d", "e", "h", "p"] },
    { "before": ["leader", "v", "b"], "after": ["\"", "z", "d", "b", "h", "p"] },
    { "before": ["leader", "v", "I"], "after": ["\"", "z", "d", "^", "p"] },
    { "before": ["leader", "v", "D"], "after": ["\"", "z", "d", "$", "p"] },
    { "before": ["leader", "v", "C"], "after": ["\"", "z", "d", "$", "p"] },
    // ---- レジスタ内を貼り付け
    { "before": ["leader", "v", "1"], "after": ["\"", "1", "p"] },
    { "before": ["leader", "v", "2"], "after": ["\"", "2", "p"] },
    { "before": ["leader", "v", "3"], "after": ["\"", "3", "p"] },
    { "before": ["leader", "v", "4"], "after": ["\"", "4", "p"] },
    { "before": ["leader", "v", "5"], "after": ["\"", "5", "p"] },
    { "before": ["leader", "v", "6"], "after": ["\"", "6", "p"] },
    { "before": ["leader", "v", "7"], "after": ["\"", "7", "p"] },
    { "before": ["leader", "v", "8"], "after": ["\"", "8", "p"] },
    { "before": ["leader", "v", "9"], "after": ["\"", "9", "p"] },
    { "before": ["leader", "v", "z"], "after": ["\"", "z", "p"] }, // 上記置換貼付後、前括弧(引用符)内
    { "before": ["leader", "v", "-"], "after": ["\"", "-", "p"] }, // 1行以下の削除内容
    { "before": ["leader", "v", "%"], "after": ["\"", "%", "p"] }, // ファイル名
    { "before": ["leader", "v", "#"], "after": ["\"", "#", "p"] }, // 前のファイル名
    { "before": ["leader", "v", "*"], "after": ["\"", "*", "p"] }, // クリップボード内
    // --- 行単位を貼り付け+貼り付け部分になにかする(ファイル末尾では使えない)
    { "before": ["leader", "v", "v"], "after": ["m", "m", "g", "p", "k", "V", "`", "m", "j"] }, // 選択
    { "before": ["leader", "v", "c"], "after": ["m", "m", "g", "p", "k", "V", "`", "m", "j", "g", "c"] }, // コメントトグル
    // ------- x => なにか情報表示----------
    { "before": ["leader", "x", "x"], "commands": [":register"] }, // レジスタリスト
    { "before": ["leader", "x", "j"], "commands": [":jump"] }, // ジャンプリスト
    { "before": ["leader", "x", "m"], "commands": ["bookmarks.listFromAllFiles"] }, // vimのマークリスト
    { "before": ["leader", "x", "f"], "commands": ["gitlens.views.branches.setFilesLayoutToList"] }, // vimのマークリスト
    // ------- : => コマンドライン ----------
    // { [ "leader", ":", ":"] -> 選択行をコマンド実行
    // { [ "leader", ":", "c" ] -> 選択行+ファイル名をコマンド実行
    {
      "before": ["leader", ":", "d"],
      "commands": [
        // cd
        "workbench.action.terminal.scrollToBottom",
        {
          "command": "workbench.action.terminal.sendSequence",
          "args": { "text": "cd ${workspaceFolder}\n" }
        }
      ]
    },
    {
      "before": ["leader", ":", "l"],
      "commands": [
        // ls(tree)
        "workbench.action.terminal.scrollToBottom",
        {
          "command": "workbench.action.terminal.sendSequence",
          "args": { "text": "tree\n" }
        }
      ]
    },
    {
      "before": ["leader", ":", "p"],
      "commands": [
        // python をモジュール実行
        "workbench.action.terminal.scrollToBottom",
        {
          "command": "workbench.action.terminal.sendSequence",
          "args": {
            "text": "cd ${fileDirname}\n cd ..\npython -m ${relativeFileDirname}.${fileBasenameNoExtension}\n"
          }
        }
      ]
    },
    {
      "before": ["leader", ":", "m"],
      "commands": [
        // python オプション付きでモジュール実行
        "workbench.action.terminal.scrollToBottom",
        {
          "command": "workbench.action.terminal.sendSequence",
          "args": {
            "text": "cd ${fileDirname}\n cd ..\npython -m ${relativeFileDirname}.${fileBasenameNoExtension} "
          }
        },
        "workbench.action.terminal.focus"
      ]
    },
    {
      "before": ["leader", ":", "t"],
      "commands": [
        // pytest
        "workbench.action.terminal.scrollToBottom",
        {
          "command": "workbench.action.terminal.sendSequence",
          "args": { "text": "cd ${workspaceFolderBasename} \n pytest -m " }
        },
        "workbench.action.terminal.focus"
      ]
    }
  ],
  "vim.visualModeKeyBindings": [
    {
      "before": ["leader", ";"],
      "after": ["\"", "c", "y", "leader", ":"]
    } // コマンドを記憶して実行
  ],
  "vim.visualModeKeyBindingsNonRecursive": [
    { "before": ["leader", "j"], "after": ["L"] }, // 画面上一番下へ移動
    { "before": ["leader", "k"], "after": ["H"] }, //  画面上一番上へ移動
    { "before": ["g", "j"], "after": ["L"] }, // 画面上一番下へ移動 ★
    { "before": ["g", "k"], "after": ["H"] }, //  画面上一番上へ移動 ★
    { "before": ["j"], "after": ["g", "j"] }, // 見た目の行で移動
    { "before": ["k"], "after": ["g", "k"] }, // 見た目の行で移動
    { "before": ["g", "h"], "after": ["^"] }, // 行頭へ★★
    { "before": ["g", "l"], "after": ["$"] }, // 行末へ★★
    { "before": ["K"], "after": ["H", "z", "z"] }, // 実質半PageUp
    { "before": ["J"], "after": ["L", "z", "z"] }, // 実質半PageDown
    { "before": ["c"], "after": ["g", "c"] }, // コメント切り替え
    {
      "before": ["leader", "m"],
      "commands": ["editor.emmet.action.wrapWithAbbreviation"]
    }, //選択範囲をタグで囲む
    { "before": ["\\"], "after": [":", "s", "/"] }, // 範囲内置換(暫定)
    { "before": ["q"], "commands": ["editor.action.formatSelection"] }, // 範囲内を整形
    { "before": ["leader", "f"], "after": ["/", "\\", "%", "V"] }, //選択範囲内を検索
    { "before": ["v"], "commands": ["editor.action.smartSelect.expand"] }, // 選択範囲を拡張
    // 選択範囲をターミナルで実行

    { "before": ["ctrl+d"], "after": ["g", "b"] },
    {
      "before": ["leader", ":"],
      "commands": [
        "workbench.action.terminal.scrollToBottom",
        {
          "command": "workbench.action.terminal.sendSequence",
          "args": { "text": "${selectedText}\n " }
        }
      ]
    },

  ],
  "vim.insertModeKeyBindings": [
    // emmet 展開(実際はshift+tab)
    { "before": ["ctrl+p"], "after": ["ctrl+d", "Esc", "s", ">", "<", "a"] }
  ],
  "vim.insertModeKeyBindingsNonRecursive": [
    { "before": ["ctrl+l"], "commands": ["deleteRight"] }, // Deleteキー代わり
    { "before": ["j", "j"], "after": ["Esc"] }, // jjでエスケープ
    {
      "before": ["ctrl+d"],
      "commands": ["editor.emmet.action.expandAbbreviation"]
    } //実際はctrl+1
  ],

キーボードショートカット

キーボードショートカットはこっち。

[
    //-----------------------------------------------------------------
    // vimキーとVSCodeキーの選択
    //------------------------------------------------------------------
    // ctrl+ の機能メモ
    // a: vs(全選択) vim側で設定
    // b: vim(pageUp)
    // c: vs(コピー)
    // d: vs(同じ単語でマルチカーソル) -> vim仕様に変更
    // e: vim(下スクロール:下と同じ入力)
    // f: vim(pageDown)
    // g: original(カーソル下に拡張)
    // h: original(タブ移動)
    // i: vim(next jump)
    // j: vs(panel toggle)
    // k: vs(prefix)
    // l: original(タブ移動)
    // m: original(bookmarks prefix)
    // n: vs(newfile)
    // o: vim(prev jump:command)
    // p: vs(open file)
    // q: vs(quick menu)
    // r: vim(redo: paste register)
    // s: original(incriment)
    // t: original(editor<->terminal)
    // u: vim(半pageUp:delete from start)
    // v: vim(矩形選択)
    // w: vs(ウィンドウを閉じる)
    // x: vim(decriment)
    // y: vim(上scroll:上と同じ入力)
    // z: vs(Undo)
    // []: vs(indent)
    // \: ワークスペース切り替え
    // /: vs(comment)
    //-----------------------------------------------------------------------
    // ctrl+aは全選択にしたいのでctrl+sでインクリメントする(ctrl+sがないので使わないctrl+mのコマンドに割り当てる)
    {
        "key": "ctrl+m",
        "command": "-extension.vim_ctrl+m",
        "when": "editorTextFocus && vim.active && vim.use<C-m> && !inDebugRepl || vim.active && vim.use<C-m> && !inDebugRepl && vim.mode == 'CommandlineInProgress' || vim.active && vim.use<C-m> && !inDebugRepl && vim.mode == 'SearchInProgressMode'"
    },
    {
        "key": "ctrl+s",
        "command": "extension.vim_ctrl+m",
        "when": "editorTextFocus && vim.active && vim.use<C-m> && !inDebugRepl"
    },
    // 癖で押してしまうためVSCode優先。
    {
        "key": "ctrl+c",
        "command": "-extension.vim_ctrl+c",
        "when": "editorTextFocus && vim.active && vim.overrideCtrlC && vim.use<C-c> && !inDebugRepl"
    },
    // カーソル拡張
    {
        "key": "ctrl+g",
        "command": "-workbench.action.gotoLine"
    },
    {
        "key": "ctrl+g",
        "command": "-extension.vim_ctrl+g",
        "when": "editorTextFocus && vim.active && vim.use<C-g> && !inDebugRepl"
    },
    {
        "key":"ctrl+g",
        "command":"editor.action.insertCursorBelow",
    },
    // 左右移動 (vimではノーマルモード時のみ移動にしたいのでsettingsで別設定)
    // {
    //     "key": "ctrl+h",
    //     "command": "-extension.vim_ctrl+h",
    //     "when": "editorTextFocus && vim.active && vim.use<C-h> && !inDebugRepl"
    // },
    {
        "key": "ctrl+h",
        "command": "workbench.action.previousEditorInGroup",
        "when": "!terminalFocus && vim.mode != 'Insert'&& activeWebviewPanelId != 'GitHub Copilot Suggestions'"
    },
    // {
    //     "key": "ctrl+l",
    //     "command": "-extension.vim_navigateCtrlL",
    //     "when": "editorTextFocus && vim.active && vim.use<C-l> && !inDebugRepl"
    // },
    {
        "key": "ctrl+l",
        "command": "workbench.action.nextEditorInGroup",
        "when": "!terminalFocus&& vim.mode != 'Insert' && activeWebviewPanelId != 'GitHub Copilot Suggestions'"
    },
    // Vimのctrl+jは不要
    {
        "key": "ctrl+j",
        "command": "-extension.vim_ctrl+j",
        "when": "editorTextFocus && vim.active && vim.use<C-j> && !inDebugRepl"
    },
    // vimのマルチバイト入力は捨てる
    {
        "key": "ctrl+k",
        "command": "-extension.vim_ctrl+k",
        "when": "editorTextFocus && vim.active && vim.use<C-k> && !inDebugRepl"
    },
    // VSCodeのタブ機能切替は事故のもとなので無効化しておく。vimも使わないので空き。
    {
        "key": "ctrl+m",
        "command": "-editor.action.toggleTabFocusMode"
    },
    // vimのctrl+nは使わない
    {
        "key": "ctrl+n",
        "command": "-extension.vim_ctrl+n",
        "when": "editorTextFocus && vim.active && vim.use<C-n> && !inDebugRepl || vim.active && vim.use<C-n> && !inDebugRepl && vim.mode == 'CommandlineInProgress' || vim.active && vim.use<C-n> && !inDebugRepl && vim.mode == 'SearchInProgressMode'"
    },
    // vimのctrl+pは不要。
    {
        "key": "ctrl+p",
        "command": "-extension.vim_ctrl+p",
        "when": "suggestWidgetVisible && vim.active && vim.use<C-p> && !inDebugRepl || vim.active && vim.use<C-p> && !inDebugRepl && vim.mode == 'CommandlineInProgress' || vim.active && vim.use<C-p> && !inDebugRepl && vim.mode == 'SearchInProgressMode'"
    },
    // vimのctrl+qはctrl+vと同じなのでVSCodeのクイックメニューを優先。
    {
        "key": "ctrl+q",
        "command": "-extension.vim_winCtrlQ",
        "when": "editorTextFocus && vim.active && vim.use<C-q> && !inDebugRepl"
    },
    // vimのctrl+tは使わないのでターミナルとの行き来用に変更
    {
        "key": "ctrl+t",
        "command": "-extension.vim_ctrl+t",
        "when": "editorTextFocus && vim.active && vim.use<C-t> && !inDebugRepl"
    },
    {
        "key": "ctrl+t",
        "command": "-workbench.action.showAllSymbols"
    },
    {
        "key": "ctrl+t",
        "command": "workbench.action.terminal.focus",
    },
    // vimのctrl+vは必須。(本来設定なしで優先されるはずだが、貼り付けが発動することあったので一応無効化)
    {
        "key": "ctrl+v",
        "command": "-editor.action.clipboardPasteAction"
    },
    // VSCodeのマルチカーソル機能優先。vimのg->bも同じ機能だが押しにくい。
    // {
    //     "key": "ctrl+d",
    //     "command": "-extension.vim_ctrl+d",
    //     "when": "editorTextFocus && vim.active && vim.use<C-d> && !inDebugRepl"
    // },
    // tabは選択範囲を維持して入れられるVSCodeショートカットの方をを有効化
    {
        "key": "ctrl+[",
        "command": "-extension.vim_ctrl+[",
        "when": "editorTextFocus && vim.active && vim.use<C-[> && !inDebugRepl"
    },
    {
        "key": "ctrl+]",
        "command": "-extension.vim_ctrl+]",
        "when": "editorTextFocus && vim.active && vim.use<C-]> && !inDebugRepl"
    },
    //-------------------------------------
    // ctrl+k + hlはペイン移動に割り当てる
    //-------------------------------------
    {
        "key": "shift+control+l",
        "command": "workbench.action.focusFirstEditorGroup",
        "when": "sideBarFocus"
    },
    {
        "key": "shift+ctrl+h",
        "command": "workbench.action.focusSideBar",
        "when": "!panelFocus && !sideBarFocus && activeEditorGroupIndex==1"
    },
    {
        "key": "shift+ctrl+h",
        "command": "workbench.action.focusLeftGroup",
        "when": "!panelFocus && !sideBarFocus&& activeEditorGroupIndex!=1"
    },
    {
        "key": "shift+ctrl+k",
        "command": "workbench.action.showCommands",
        "when": "!panelFocus"
    },
    {
        "key": "shift+ctrl+l",
        "command": "workbench.action.focusRightGroup",
        "when": "!panelFocus && !sideBarFocus"
    },
    {
        "key": "shift+ctrl+l",
        "command": "workbench.action.focusFirstEditorGroup",
        "when": "sideBarFocus"
    },
    {
        "key": "shift+ctrl+j",
        "command": "workbench.action.focusPanel",
        "when": "!panelFocus && !sideBarFocus"
    },
    {
        "key": "shift+ctrl+k",
        "command": "workbench.action.focusActiveEditorGroup",
        "when": "panelFocus "
    },
    {
        "key": "shift+ctrl+h",
        "command": "workbench.action.terminal.focusPreviousPane",
        "when": "terminalFocus"
    },
    {
        "key": "shift+ctrl+l",
        "command": "workbench.action.terminal.focusNextPane",
        "when": "terminalFocus"
    },
    //-------------------------------------
    // ctrl+jkでいろいろ上下移動
    //-------------------------------------
    // 候補のフォーカス
    {
        "key": "ctrl+j",
        "command": "selectNextSuggestion",
        "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
    },
    {
        "key": "ctrl+k",
        "command": "selectPrevSuggestion",
        "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
    },
    // ヒント
    {
        "key": "ctrl+j",
        "command": "showNextParameterHint",
        "when": "editorTextFocus && parameterHintsMultipleSignatures && parameterHintsVisible && textInputFocus"
    },
    {
        "key": "ctrl+k",
        "command": "showPrevParameterHint",
        "when": "editorTextFocus && parameterHintsMultipleSignatures && parameterHintsVisible && textInputFocus"
    },
    // quick fix (効かない?)
    {
        "key": "j",
        "command": "selectNextQuickFix",
        "when": "editorFocus && quickFixWidgetVisible"
    },
    {
        "key": "k",
        "command":"selectPreviousQuickFix",
        "when": "editorFocus && quickFixWidgetVisible"
    },
    // hover内
    {
        "key": "ctrl+j",
        "command": "editor.action.scrollDownHover",
        "when": "editorHoverFocused && editorHoverVisible"
    },
    {
        "key": "ctrl+k",
        "command": "editor.action.scrollUpHover",
        "when": "editorHoverFocused && editorHoverVisible"
    },

    // リスト
    {
        "key": "ctrl+j",
        "command": "list.focusDown",
        "when": "listFocus"
    },
    {
        "key": "ctrl+k",
        "command":"list.focusUp",
        "when": "listFocus"
    },
    // クイックオープン
    {
        "key": "ctrl+j",
        "command":"workbench.action.quickOpenSelectNext",
        "when": "inQuickOpen"
    },
    {
        "key": "ctrl+k",
        "command":"workbench.action.quickOpenSelectPrevious",
        "when": "inQuickOpen"
    },
    // 閉じるのはEscだとクイックメニュー時に都合悪いので別のキーvim的には左か右で閉じる感覚
    {
        "key": "ctrl+h",
        "command": "workbench.action.closeQuickOpen",
        "when": "inQuickOpen"
    },
    {
        "key": "ctrl+l",
        "command": "workbench.action.closeQuickOpen",
        "when": "inQuickOpen"
    },
    //-------------------------------
    // エクスプローラー explorer
    //-------------------------------
    // {
    //     "key": "l",
    //     "command": "workbench.action.focusActiveEditorGroup",
    //     "when": "explorerViewletFocus && explorerViewletVisible && !inputFocus"
    // },
    //新規ファイル作成
    {
        "key": "ctrl+h",
        "command": "workbench.action.previousSideBarView",
        "when": "sideBarFocus && sideBarVisible"
    },
    {
        "key": "ctrl+l",
        "command": "workbench.action.nextSideBarView",
        "when": "sideBarFocus && sideBarVisible"
    },
    //新規ファイル作成
    {
        "key": "n",
        "command": "explorer.newFile",
        "when": "explorerViewletFocus && explorerViewletVisible && !inputFocus"
    },
    //新規フォルダ作成
    {
        "key": "f",
        "command": "explorer.newFolder",
        "when": "explorerViewletFocus && explorerViewletVisible && !inputFocus"
    },
    //エクスプローラーでフォルダを開く
    {
        "key": "e",
        "command": "revealFileInOS",
        "when": "explorerViewletFocus && explorerViewletVisible && !inputFocus"
    },
    //リネーム
    {
        "key": "r",
        "command": "renameFile",
        "when": "explorerViewletFocus && explorerViewletVisible && !inputFocus"
    },
    //削除
    {
        "key": "d",
        "command": "deleteFile",
        "when": "explorerViewletFocus && explorerViewletVisible && !inputFocus"
    },
    //削除
    {
        "key": "g l",
        "command": "workbench.action.focusFirstEditorGroup",
        "when": "explorerViewletFocus && explorerViewletVisible && !inputFocus"
    },
    //-------------------------------
    // ターミナル
    // ctrl+ c, p, q, r は割り当てないように!
    //-------------------------------

    {
        "key": "ctrl+j",
        "command": "workbench.action.focusActiveEditorGroup",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+t",
        "command": "workbench.action.focusActiveEditorGroup",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+oem_plus",
        "command": "workbench.action.toggleMaximizedPanel",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+k",
        "command": "workbench.action.terminal.scrollUpPage",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+j",
        "command": "workbench.action.terminal.scrollDownPage",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+g",
        "command": "workbench.action.terminal.scrollUpPage",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+z",
        "command": "workbench.action.terminal.kill",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+h",
        "command": "workbench.action.terminal.focusPreviousPane",
        "when": "terminalFocus"
    },
    //------------------------------------------------
    // Bookmarks (ctrl+mをプレフィクスとして使う)
    // vimのマーク機能はファイル内一時マーク用
    //  Bookmarksはファイルまたいで長く使うマーク用
    //------------------------------------------------
    {
        "key": "ctrl+m ctrl+m",
        "command": "bookmarks.toggle",
        "when": "editorTextFocus"
    },
    // ラベル付きブックマーク
    {
        "key": "ctrl+m ctrl+n",
        "command":"bookmarks.toggleLabeled",
        "when": "editorTextFocus"
    },
    // リストから選ぶ ctrl押しっぱなしでm+kjだけで選択可
    {
        "key": "ctrl+m ctrl+j",
        "command":"bookmarks.listFromAllFiles",
    },
    {
        "key": "ctrl+m ctrl+k",
        "command":"bookmarks.listFromAllFiles",
    },
    // 次と前へ移動(defaultの表示の拡大縮小はいらないのでつぶす)
    {
        "key": "ctrl+oem_plus",
        "command":"bookmarks.jumpToNext",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+-",
        "command":"bookmarks.jumpToPrevious",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+m ctrl+i",
        "command":"bookmarks.list",
        "when": "editorTextFocus"
    },
    // マーク位置を選択
    {
        "key": "ctrl+m ctrl+o",
        "command": "bookmarks.selectLines",
        "when": "editorTextFocus",
    },
    // ファイル内全削除
    {
        "key": "ctrl+m c",
        "command":"bookmarks.clear"
    },
    //------------------------------------------------
    // git hub copilot
    // 主にパネルが表示されてるときのショートカット
    //------------------------------------------------
    {
        "key": "ctrl+e",
        "command":"workbench.action.focusLastEditorGroup",
        "when":"github.copilot.activated && github.copilot.panelVisible && activeWebviewPanelId == 'GitHub Copilot Suggestions'"
    },
    //==============================================================
    // shift+tabをsetting.jsonでvimに割り当てるために
    {
        "key": "shift+tab",
        "command": "extension.vim_ctrl+p",
        "when": "vim.active && vim.use<C-p>",
    },
    {
        "key": "ctrl+1",
        "command": "extension.vim_ctrl+d",
        "when": "editorTextFocus && vim.active && vim.use<C-d> && vim.mode=='Insert'"
    },
    {
        "key": "shift+tab",
        "command": "-insertPrevSuggestion",
        "when": "hasOtherSuggestions && textInputFocus && !inSnippetMode && !suggestWidgetVisible && config.editor.tabCompletion == 'on'"
    },
    {
        "key": "ctrl+oem_102",
        "command": "vscodeWorkspaceSwitcher.openWorkspace"
    },
    {
        "key": "ctrl+k w",
        "command": "-vscodeWorkspaceSwitcher.openWorkspace"
    },
    {
        "key": "ctrl+q",
        "command": "workbench.action.quickOpenView",
        "when": "!terminalFocus"
    },
    {
        "key": "ctrl+q",
        "command": "-workbench.action.quickOpenView"
    },
    {
        "key": "ctrl+p",
        "command": "workbench.action.quickOpen",
        "when": "editorTextFocus"
    },
    {
        "key": "ctrl+p",
        "command": "-workbench.action.quickOpen"
    },
    {
        "key": "ctrl+w",
        "command": "-extension.vim_ctrl+w",
        "when": "editorTextFocus && vim.active && vim.use<C-w> && !inDebugRepl"
    },
    {
        "key": "ctrl+oem_4",
        "command": "-editor.action.outdentLines",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "ctrl+oem_6",
        "command": "-editor.action.indentLines",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "ctrl+oem_4",
        "command": "inlineChat.start",
        "when": "editorFocus && inlineChatHasProvider && !editorReadonly"
    },
    {
        "key": "ctrl+i",
        "command": "-inlineChat.start",
        "when": "editorFocus && inlineChatHasProvider && !editorReadonly"
    },
    {
        "key": "ctrl+oem_4",
        "command": "workbench.action.terminal.chat.start",
        "when": "terminalChatAgentRegistered && terminalFocusInAny && terminalHasBeenCreated || terminalChatAgentRegistered && terminalFocusInAny && terminalProcessSupported"
    },
    {
        "key": "ctrl+i",
        "command": "-workbench.action.terminal.chat.start",
        "when": "terminalChatAgentRegistered && terminalFocusInAny && terminalHasBeenCreated || terminalChatAgentRegistered && terminalFocusInAny && terminalProcessSupported"
    },
    {
        "key": "ctrl+oem_4",
        "command": "workbench.action.terminal.chat.focusInput",
        "when": "terminalChatFocus && !inlineChatFocused"
    },
    {
        "key": "ctrl+i",
        "command": "-workbench.action.terminal.chat.focusInput",
        "when": "terminalChatFocus && !inlineChatFocused"
    },
    {
        "key": "ctrl+oem_4",
        "command": "workbench.action.chat.startVoiceChat",
        "when": "chatIsEnabled && hasSpeechProvider && inChatInput && !chatSessionRequestInProgress && !editorFocus && !notebookEditorFocused && !scopedVoiceChatGettingReady && !speechToTextInProgress && !terminalChatActiveRequest || chatIsEnabled && hasSpeechProvider && inlineChatFocused && !chatSessionRequestInProgress && !editorFocus && !notebookEditorFocused && !scopedVoiceChatGettingReady && !speechToTextInProgress && !terminalChatActiveRequest"
    },
    {
        "key": "ctrl+i",
        "command": "-workbench.action.chat.startVoiceChat",
        "when": "chatIsEnabled && hasSpeechProvider && inChatInput && !chatSessionRequestInProgress && !editorFocus && !notebookEditorFocused && !scopedVoiceChatGettingReady && !speechToTextInProgress && !terminalChatActiveRequest || chatIsEnabled && hasSpeechProvider && inlineChatFocused && !chatSessionRequestInProgress && !editorFocus && !notebookEditorFocused && !scopedVoiceChatGettingReady && !speechToTextInProgress && !terminalChatActiveRequest"
    },
    {
        "key": "ctrl+oem_4",
        "command": "workbench.action.chat.stopListeningAndSubmit",
        "when": "inChatInput && voiceChatInProgress && scopedVoiceChatInProgress == 'editor' || inChatInput && voiceChatInProgress && scopedVoiceChatInProgress == 'inline' || inChatInput && voiceChatInProgress && scopedVoiceChatInProgress == 'quick' || inChatInput && voiceChatInProgress && scopedVoiceChatInProgress == 'terminal' || inChatInput && voiceChatInProgress && scopedVoiceChatInProgress == 'view' || inlineChatFocused && voiceChatInProgress && scopedVoiceChatInProgress == 'editor' || inlineChatFocused && voiceChatInProgress && scopedVoiceChatInProgress == 'inline' || inlineChatFocused && voiceChatInProgress && scopedVoiceChatInProgress == 'quick' || inlineChatFocused && voiceChatInProgress && scopedVoiceChatInProgress == 'terminal' || inlineChatFocused && voiceChatInProgress && scopedVoiceChatInProgress == 'view'"
    },
    {
        "key": "ctrl+i",
        "command": "-workbench.action.chat.stopListeningAndSubmit",
        "when": "inChatInput && voiceChatInProgress && scopedVoiceChatInProgress == 'editor' || inChatInput && voiceChatInProgress && scopedVoiceChatInProgress == 'inline' || inChatInput && voiceChatInProgress && scopedVoiceChatInProgress == 'quick' || inChatInput && voiceChatInProgress && scopedVoiceChatInProgress == 'terminal' || inChatInput && voiceChatInProgress && scopedVoiceChatInProgress == 'view' || inlineChatFocused && voiceChatInProgress && scopedVoiceChatInProgress == 'editor' || inlineChatFocused && voiceChatInProgress && scopedVoiceChatInProgress == 'inline' || inlineChatFocused && voiceChatInProgress && scopedVoiceChatInProgress == 'quick' || inlineChatFocused && voiceChatInProgress && scopedVoiceChatInProgress == 'terminal' || inlineChatFocused && voiceChatInProgress && scopedVoiceChatInProgress == 'view'"
    },
    {
        "key": "ctrl+j",
        "command": "workbench.action.togglePanel",
        "when": "!editorHoverFocused && !quickInputVisible && !searchViewletVisible && !terminalFocus && !terminalFindWidgetFocus && !terminalFocusInFindWidget"
    },
    {
        "key": "ctrl+k ctrl+l",
        "command": "-editor.toggleFold",
        "when": "editorTextFocus && foldingEnabled"
    },
    {
        "key": "ctrl+shift+d",
        "command": "-workbench.view.debug",
        "when": "viewContainer.workbench.view.debug.enabled"
    },
    {
        "key": "ctrl+shift+d",
        "command": "addCursorsAtSearchResults",
        "when": "fileMatchOrMatchFocus && searchViewletVisible"
    },
    {
        "key": "ctrl+shift+l",
        "command": "-addCursorsAtSearchResults",
        "when": "fileMatchOrMatchFocus && searchViewletVisible"
    },
    {
        "key": "ctrl+shift+d",
        "command": "editor.action.selectHighlights",
        "when": "editorFocus"
    },
    {
        "key": "ctrl+shift+l",
        "command": "-editor.action.selectHighlights",
        "when": "editorFocus"
    },
    {
        "key": "ctrl+shift+d",
        "command": "notebook.selectAllFindMatches",
        "when": "config.notebook.multiCursor.enabled && notebookFindWidgetFocused || config.notebook.multiCursor.enabled && notebookCellEditorFocused && activeEditor == 'workbench.editor.notebook'"
    },
    {
        "key": "ctrl+shift+l",
        "command": "-notebook.selectAllFindMatches",
        "when": "config.notebook.multiCursor.enabled && notebookFindWidgetFocused || config.notebook.multiCursor.enabled && notebookCellEditorFocused && activeEditor == 'workbench.editor.notebook'"
    },
    {
        "key": "ctrl+shift+d",
        "command": "selectAllSearchEditorMatches",
        "when": "inSearchEditor"
    },
    {
        "key": "ctrl+shift+l",
        "command": "-selectAllSearchEditorMatches",
        "when": "inSearchEditor"
    },
    {
        "key": "ctrl+shift+k",
        "command": "-editor.action.deleteLines",
        "when": "textInputFocus && !editorReadonly"
    },
    {
        "key": "ctrl+shift+j",
        "command": "-workbench.action.search.toggleQueryDetails",
        "when": "inSearchEditor || searchViewletFocus"
    },
    {
        "key": "ctrl+j",
        "command": "-workbench.action.togglePanel"
    }
]

Uncategorized

Posted by gran-gran-gran