zoukankan      html  css  js  c++  java
  • vs2015添加.snippet文件,实现快速模板生成

    依次找到 工具---->代码片段管理器---->语言选择(自己的开发语言)---->点击导入.snippet文件

    //文件一

    #1.snippet

    <?xml version="1.0" encoding="utf-8"?>
    <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
        <CodeSnippet Format="1.0.0">
            <Header>
                <Title>#1</Title>
                <Shortcut>#1</Shortcut>
                <Description>c语言main函数</Description>
                <Author>Microsoft Corporation</Author>
                <SnippetTypes>
                    <SnippetType>Expansion</SnippetType>
                    <SnippetType>SurroundsWith</SnippetType>
                </SnippetTypes>
            </Header>
            <Snippet>
                <Declarations>
                    <Literal>
                        <ID>expression</ID>
                        <ToolTip>要计算的表达式</ToolTip>
                        <Default>true</Default>
                    </Literal>
                </Declarations>
                <Code Language="cpp"><![CDATA[#define _CRT_SECURE_NO_WARNINGS
    #include<stdio.h>
    #include<string.h>
    #include<stdlib.h>
    #include<math.h>
    #include<time.h>
    
    int main()
    {
    
        $selected$$end$
    
        system("pause");
        return EXIT_SUCCESS;
    }
                        ]]>
                </Code>
            </Snippet>
        </CodeSnippet>
    </CodeSnippets>

    //文件二

    #2.snippet

    <?xml version="1.0" encoding="utf-8"?>
    <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
        <CodeSnippet Format="1.0.0">
            <Header>
                <Title>#2</Title>
                <Shortcut>#2</Shortcut>
                <Description>c++语言main函数</Description>
                <Author>Microsoft Corporation</Author>
                <SnippetTypes>
                    <SnippetType>Expansion</SnippetType>
                    <SnippetType>SurroundsWith</SnippetType>
                </SnippetTypes>
            </Header>
            <Snippet>
                <Declarations>
                    <Literal>
                        <ID>expression</ID>
                        <ToolTip>要计算的表达式</ToolTip>
                        <Default>true</Default>
                    </Literal>
                </Declarations>
                <Code Language="cpp"><![CDATA[#define _CRT_SECURE_NO_WARNINGS
    #include<iostream>
    using namespace std;
    
    int main()
    {
        
        $selected$$end$
    
        system("pause");
        return EXIT_SUCCESS;
    }]]>
                </Code>
            </Snippet>
        </CodeSnippet>
    </CodeSnippets>
  • 相关阅读:
    php memcache分布式和要注意的问题
    PHP延迟静态绑定(本文属于转发)
    WebSocket实战
    HTML5本地存储(Local Storage) 的前世今生
    HTML5本地存储——IndexedDB
    HTML5 FileReader
    HTML5 FormData对象
    2017-2018-1 20155225 实验四 外设驱动程序设计
    2017-2018-1 20155225 《信息安全系统设计基础》第十一周学习总结
    Linux下的IPC机制
  • 原文地址:https://www.cnblogs.com/baconZhang/p/13715255.html
Copyright © 2011-2022 走看看