美文网首页
vscode全局代码片断

vscode全局代码片断

作者: 豆豆_06fa | 来源:发表于2019-03-01 23:49 被阅读0次

    {

        // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and

        // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope

        // is left empty or omitted, the snippet gets applied to all languages. 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:

        "ph": {

            "prefix": "ph", // 触发的关键字 输入ph按下tab键

            "body": [

                "<?php $1 ?>",

            ],

            "description": "php components"

        },

        "php": {

            "prefix": "php", // 触发的关键字 输入php按下tab键

            "body": [

                "<?php",

                "$1",

                "?>",

            ],

            "description": "php components"

        },

        "rs!": {

            "prefix": "rs!", // 触发的关键字 输入rs?按下tab键

            "body": [

                "<?php echo $$rs['$1']?>",

            ],

            "description": "rs? components"

        },

        "rs": {

            "prefix": "rs", // 触发的关键字 输入rs按下tab键

            "body": [

                "echo $$rs['$1'];",

            ],

            "description": "rs components"

        },

        "v": {

            "prefix": "v", // 触发的关键字 输入v按下tab键

            "body": [

                "echo $$v['$1'];",

            ],

            "description": "v components"

        },

        "ec": {

            "prefix": "ec", // 触发的关键字 输入ec按下tab键

            "body": [

                "<?php echo $1 ?>",

            ],

            "description": "ec components"

        },

        "fo": {

            "prefix": "fo", // 触发的关键字 输入fo按下tab键

            "body": [

                "foreach($$rs as $$v){",

                "$1",

                "}",

            ],

            "description": "fo components"

        },

        "pdo": {

            "prefix": "pdo", // 触发的关键字 输入pdo按下tab键

            "body": [

                "$$pdo=new pdo('mysql:host=localhost;dbname=news','root','');",

                "$$pdo->query('set names utf8');",

            ],

            "description": "php components"

        },

        "stmt": {

            "prefix": "stmt", // 触发的关键字 输入stmt按下tab键

            "body": [

                "$$stmt=$$pdo->query($$sql);",

                "$$rs=$$stmt->fetchAll(PDO::FETCH_ASSOC);",

            ],

            "description": "php components"

        },

        "va": {

            "prefix": "va", // 触发的关键字 输入va按下tab键

            "body": [

                "var_dump($1);",

            ],

            "description": "v components"

        },

    }

    相关文章

      网友评论

          本文标题:vscode全局代码片断

          本文链接:https://www.haomeiwen.com/subject/epssuqtx.html