谢谢您的建议。
我将所有内容删除后,再打开设置文件,又会自动恢复原样。
后来试了只删除最上面一段“space”的设置并保存,再打开就不会恢复初始状态,就像下图,现在看起来正常了,按两次spc相当于F1,spc f f 会转到打开文件。
不知道我安装后的默认配置为什么会有2个“space”设置(之前回复中的截图有显示),目前还有2个tab设置。
现在keybindings.json完整的配置是这样的:
[
{
"key": "space",
"command": "vspacecode.space",
"when": "sideBarFocus && !inputFocus && !whichkeyActive"
},
{
"key": "tab",
"command": "extension.vim_tab",
"when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert' && editorLangId != 'magit'"
},
{
"key": "tab",
"command": "-extension.vim_tab",
"when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert'"
},
{
"key": "x",
"command": "magit.discard-at-point",
"when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/"
},
{
"key": "k",
"command": "-magit.discard-at-point"
},
{
"key": "-",
"command": "magit.reverse-at-point",
"when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/"
},
{
"key": "v",
"command": "-magit.reverse-at-point"
},
{
"key": "shift+-",
"command": "magit.reverting",
"when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/"
},
{
"key": "shift+v",
"command": "-magit.reverting"
},
{
"key": "shift+o",
"command": "magit.resetting",
"when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/"
},
{
"key": "shift+x",
"command": "-magit.resetting"
},
{
"key": "x",
"command": "-magit.reset-mixed"
},
{
"key": "ctrl+u x",
"command": "-magit.reset-hard"
},
{
"key": "y",
"command": "-magit.show-refs"
},
{
"key": "y",
"command": "vspacecode.showMagitRefMenu",
"when": "editorTextFocus && editorLangId == 'magit' && vim.mode == 'Normal'"
},
{
"key": "g",
"command": "-magit.refresh",
"when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/"
},
{
"key": "g",
"command": "vspacecode.showMagitRefreshMenu",
"when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/"
},
{
"key": "ctrl+j",
"command": "workbench.action.quickOpenSelectNext",
"when": "inQuickOpen"
},
{
"key": "ctrl+k",
"command": "workbench.action.quickOpenSelectPrevious",
"when": "inQuickOpen"
},
{
"key": "ctrl+j",
"command": "selectNextSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "ctrl+k",
"command": "selectPrevSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "ctrl+l",
"command": "acceptSelectedSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
},
{
"key": "ctrl+j",
"command": "showNextParameterHint",
"when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible"
},
{
"key": "ctrl+k",
"command": "showPrevParameterHint",
"when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible"
},
{
"key": "ctrl+j",
"command": "selectNextCodeAction",
"when": "codeActionMenuVisible"
},
{
"key": "ctrl+k",
"command": "selectPrevCodeAction",
"when": "codeActionMenuVisible"
},
{
"key": "ctrl+l",
"command": "acceptSelectedCodeAction",
"when": "codeActionMenuVisible"
},
{
"key": "ctrl+h",
"command": "file-browser.stepOut",
"when": "inFileBrowser"
},
{
"key": "ctrl+l",
"command": "file-browser.stepIn",
"when": "inFileBrowser"
},
{
"key": "space",
"command": "vspacecode.space",
"when": "activeEditorGroupEmpty && focusedView == '' && !whichkeyActive && !inputFocus"
}
]
settings.json
自动变成这样了:
{
"vim.easymotion": true,
"vim.useSystemClipboard": true,
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": [
"<space>"
],
"commands": [
"vspacecode.space"
]
},
{
"before": [
","
],
"commands": [
"vspacecode.space",
{
"command": "whichkey.triggerKey",
"args": "m"
}
]
}
],
"vim.visualModeKeyBindingsNonRecursive": [
{
"before": [
"<space>"
],
"commands": [
"vspacecode.space"
]
},
{
"before": [
","
],
"commands": [
"vspacecode.space",
{
"command": "whichkey.triggerKey",
"args": "m"
}
]
},
{
"before": [
">"
],
"commands": [
"editor.action.indentLines"
]
},
{
"before": [
"<"
],
"commands": [
"editor.action.outdentLines"
]
}
]
}