vscode

vue

我的vue文件终于可以有模板并且有html补全功能了。

ctrl+shift+p ,找到snippets---->输入vue---->enter---->vue.json(模板根据需求自己定义)

{
	"Print to console": {
			"prefix": "vue",
			"body": [
					"<template>",
					"    <div class=\"\">\n",
					"    </div>",
					"</template>\n",
					"<script type=\"text/ecmascript-6\">",
					"export default {",
					"    name: \"\",",
					"    data() {",
					"        return {}",
					"    },",
					"    components: {},",
					"    methods: {}",
					"}",
					"</script>\n",
					"<style lang=\"scss\" scoped>",
					"</style>",
					"$2"
			],
			"description": "Log output to console"
	}
}

 settings.json,不必设置什么*.vue为html,这样模板就失效了。加上这句就好了。敲开心。

 //VSCode中emmet被自动提示覆盖问题
        "key": "tab",                   
        "command": "editor.emmet.action.expandAbbreviation",                      
        "when": "config.emmet.triggerExpansionOnTab && editorTextFocus && !editorHasMultipleSelections && !editorHasSelection && !editorReadonly && !editorTabMovesFocus" 

全局配置

由于当时配置了很久才成功,在这里存一下笔记咯。以备不时之需。

c_cpp_properties.json

{

        "configurations": [
    
            {
    
                "name": "(gdb) Launch",
    
                "intelliSenseMode": "clang-x64",
    
                "includePath": [
    
                    "${workspaceFolder}",
    
                    "D:/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++",
    
                    "D:/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32",
    
                    "D:/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/backward",
    
                    "D:/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include",
    
                    "D:/mingw64/mingw64/include",
    
                    "D:/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed"
                   
    
                ],
    
                "defines": [
    
                    "_DEBUG",
    
                    "UNICODE",
    
                    "__GNUC__=7",
    
                    "__cdecl=__attribute__((__cdecl__))"
    
                ],
    
                "browse": {
    
                    "path": [
    
                        "${workspaceFolder}",
                        "D:/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++",
    
                        "D:/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32",
    
                        "D:/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/backward",
        
                        "D:/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include",
        
                        "D:/mingw64/mingw64/include",
        
                        "D:/mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed"
    
                    ]
    
                }
    
            }
    
        ],
    
        "version": 4
    
    }
    
    

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
           // "program": "${workspaceFolder}",
            //"cwd":"${workspaceFolderDirname}",
           // "program": "${workspaceFolder}00-helloworld.js",
           "program": "${file}",
           "cwd":"${fileDirname}",
            "skipFiles": [
                "<node_internals>/**"
            ]
        },
      
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceFolder}"
        },
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,      
            "MIMode": "gdb",
            "miDebuggerPath": "D:\\mingw64\\mingw64\\bin\\gdb.exe",
            "preLaunchTask": "task g++" ,
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            
        }
    ]
}

settings.json

{
    "files.autoGuessEncoding": true,
    "files.exclude": {

        "**/.git": true,
        
        "**/.svn": true,
        
        "**/.hg": true,
        
        "**/CVS": true,
        
        "**/.DS_Store": true,
        
        "**/tmp": true,
        
        "**/node_modules": true,
        
        "**/bower_components": true,
        
        "**/dist": true
        
        },
        
        "files.watcherExclude": {
        
        "**/**": true,
        
        "**/.git/objects/**": true,
        
        "**/.git/subtree-cache/**": true,
        
        "**/node_modules/**": true,
        
        "**/tmp/**": true,
        
        "**/bower_components/**": true,
        
        "**/dist/**": true
        
        },
        
        "search.followSymlinks": false,
        // "files.associations": {
        //     "*.cjson":"jsonc",
        //     "*.wxss":"css",
        //     "*.wxs":"javascript",
        //     "*.js":"javascript",
        //     "*.pug":"jade",
        //     "*.nvue":"vue"

        // },
        // "files.associations": {
        //     "*.ejs":"html",
        //     "*.js":"html",
        //     "*.vue":"html"
        //     },  
        //    "emmet.triggerExpansionOnTab": true,
        //     "emmet.includeLanguages":{
        //     "vue-html":"html",
        //     "vue":"html"
        //     },
        // 让vscode允许自定义的代码片段提示出来
     //"editor.snippetSuggestions": "top",
     //"editor.formatOnPaste": true,
     //"editor.snippetSuggestions": "top", 
     //"emmet.showExpandedAbbreviation": "never"
        //VSCode中emmet被自动提示覆盖问题
        "key": "tab",                   
        "command": "editor.emmet.action.expandAbbreviation",                      
        "when": "config.emmet.triggerExpansionOnTab && editorTextFocus && !editorHasMultipleSelections && !editorHasSelection && !editorReadonly && !editorTabMovesFocus" 
        

        
}

tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "task g++",   
            "command": "D:\\mingw64\\mingw64\\bin\\g++.exe",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "options": {
                "cwd": "D:\\mingw64\\mingw64\\bin"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": "build"
        }
    ]
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值