VSCode 自定义代码片段

  1. File -> Preferences -> User Snippets

    2.在弹出的窗口中,选择要自定义代码片段的语言(此外选C++)

    3.根据示例,定义自己的代码片段

自定义代码片段(一)

"Print to console": {
    "prefix": "dx",
    "body": [
        "#include <iostream>$2",
        "using namespace std;",
        "$3",
        "int main()",
        "{",
        "    $1",
        "",
        "    return 0;",
        "}"

    ],
    "description": "c++"
}
posted @ 2021-04-12 16:47  bp9jISKIN  阅读(250)  评论(0编辑  收藏  举报