VScode 设置自动补全快捷键,tab键切换enter键选择。
1.Ctrl + Shift + P
搜索key
- 在
keybindings.json
文件配置中
[
{
"key": "tab",
"command": "acceptSelectedSuggestion",
"when": "suggestWidgetVisible && textInputFocus"
},
{
"key": "shift+tab",
"command": "acceptSelectedSuggestion",
"when": "suggestWidgetVisible && textInputFocus"
},
{
"key": "tab",
"command": "selectNextSuggestion",
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
},
{
"key": "shift+tab",
"command": "selectPrevSuggestion",
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
}
]
这样就可以用 Tab,Shift+Tab 循环选择,接受按Enter,想取消就按 Esc。