是否有"仅使用Tab或Enter提交" Visual Studio Code中的选项?

时间:2016-02-03 06:54:52

标签: visual-studio visual-studio-code

是否有"仅使用Tab或Enter提交" Visual Studio Code中的选项?

如果是,如何取消选中此选项?

2 个答案:

答案 0 :(得分:2)

浏览默认的keybindings.json文件后,我想我们可以配置它。

首先,从File>中调出键绑定设置文件。偏好>键盘快捷键。

然后在右侧粘贴以下代码:

// Place your key bindings in this file to overwrite the defaults
[
    {
        "key": "shift+9", // (
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "shift+0", // )
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "shift+,", // <
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "shift+.", // >
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "[",
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "]",
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "space",
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": ",",
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "shift+;", // :
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "shift+/", // ?
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": ";",
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "=",
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "numpad_add", // + 
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "shift+=", // + 
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "shift+8", // *
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "numpad_multiply", // *
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "-", // -
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "numpad_subtract", // -
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "/", // /
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "numpad_divide", // /
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "shift+7", // &
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    },
    {
        "key": "shift+\\", // |
        "command": "^acceptSelectedSuggestion",
        "when": "editorTextFocus && suggestWidgetVisible && suggestionSupportsAcceptOnKey"
    }
]

保存文件,密钥绑定应立即生效。

如果您愿意,可以添加更多提交字符,只需按照模式。

答案 1 :(得分:0)

据我所知,在撰写本文时,Visual Studio Code没有此选项,抱歉。