Step 1 打开开发工具VsCode
Step 2 按F1,然后在出现的输入框中输入snippets
Step 3 选择对应语言
(如果没有该用第二种,首选项=》用户代码片段
mac 直接在Users/用户名/Library/Application Support/Code/User/snippets 新建对应语言的json文件)
Step 4 修改json 文件
例如: php
{
// Place your snippets for php here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"func": {
"prefix": "func",
"body": ["function xxx() {", "", "}"],
"description": "function"
},
"rev": {
"prefix": "rev",
"body": ["return view();"],
"description": "rev"
},
"Rot": {
"prefix": "Rot",
"body": ["Route::get('test', 'TestController@index')->name('test');"],
"description": "Rot"
},
"des": {
"prefix": "des",
"body": [
"/**",
" * ++++++++ ",
" * @auth rui.chen ",
" * @date 20220222 ",
" * @desc ",
" * +++++++++",
" **/ "
],
"description": "des"
}
}