vscode自动生成模版name默认为文件名mac版
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vscode自动生成模版name默认为文件名mac版相关的知识,希望对你有一定的参考价值。
参考技术A 一.code -- 首选项 -- 用户片段二.cmd+p打开搜索面板搜索vue.json,点击打开
三. 最后全文复制就好啦! 戳这里
// Place your snippets for vue 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"
//
"Print vue model":
"prefix": "vue",
"body": [
"<template>",
" <div>$1",
" </div>",
"</template>\n",
"<script>",
"export default ",
" name:'$TM_FILENAME_BASE',",
" data() ",
" return \n",
" ",
" ,",
" components: ",
" ",
"",
"</script>\n",
"<style lang=\"scss\">",
"</style>",
"$2"
],
"description": "my vue model"
注:1.其中的$1, $2 是快速生成后光标位置,先位于$1,按下Tab键后位于$2
2.自动生成name的秘诀就在$TM_FILENAME_BASE,详戳 这里 。
mac vscode 调试 c++
mac 上如何用vscode调试c++
笔者使用的Catalina系统,catalina已经不支持lldb了
所以要先下载插件codeLLDB
接下来在打开的项目都.vscode文件下添加配置文件
launch.json
"configurations": [
"name": "(lldb) 启动",
"type": "lldb",
"request": "launch",
"program": "$fileDirname/a.out",
"args": [],
"cwd": "$fileDirname", //fileDirname是打开的当前文件所在的文件夹的路径
"preLaunchTask": "Build with Clang" //这是所选择的task的名字
]
tasks.json
"version": "2.0.0",
"tasks": [
"label": "Build with Clang", //这里的名字必须和上面的preLaunchTask一样
"command": "g++",
"args": [
"-std=c++17",
"-stdlib=libc++",
"$file", //file是打开的当前文件的路径
"-o",
"$fileDirname/a.out",
"--debug"
],
"group":
"kind": "build",
"isDefault": true
]
结果展示
以上是关于vscode自动生成模版name默认为文件名mac版的主要内容,如果未能解决你的问题,请参考以下文章