vscodeでVimを導入し、インサートモードを設定する

概要

vscodevimを導入したものの、下に移動するコマンドjが使えなくて試行錯誤したのでメモする。

環境

vscode 1.40.2
Vim 1.12.2

keybindings.jsonファイルを開く

code => Preferences => Keyboard Shortcutsへ移動

f:id:oosakik:20191212012138p:plain

ここのextension.vim_escapeコマンドをEscapeにしたいのだが、編集をしてescコマンドを打つと、なぜか終了してしまい、うまく設定できない。そこで以下の赤く囲われているところをクリックしてkeybindings.jsonファイルを開く。

f:id:oosakik:20191212012257p:plain

keybindings.jsonファイルの編集

keybindings.jsonファイルを以下のように変更。

// Place your key bindings in this file to override the defaultsauto[]
[
    {
        "key": "escape",
        "command": "extension.vim_escape",
        "when": "editorTextFocus && vim.active && !inDebugRepl"
    },
    {
        "key": "escape",
        "command": "-extension.vim_escape",
        "when": "editorTextFocus && vim.active && !inDebugRepl"
    },
    {
        "key": "tab cmd+",
        "command": "jumpToNextSnippetPlaceholder",
        "when": "editorTextFocus && hasNextTabstop && inSnippetMode"
    },
    {
        "key": "tab",
        "command": "-jumpToNextSnippetPlaceholder",
        "when": "editorTextFocus && hasNextTabstop && inSnippetMode"
    }
]

参照文献

Visual Studio Codeを使ってみる。-どん底から這い上がるまでの記録