一、自定义sinppets方式
1、在VS安装路径【D:\vs2013\VC\Snippets\2052\Visual C++】下新建一个snippt文件
2、添加代码
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>jude</Title>
<Shortcut>jude</Shortcut>
<Description>注释片段</Description>
<Author>rainbow</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[
/*****************************************************************/
//作者:朱小勇
//函数名称:NULL
//函数参数:NULL
//函数返回值:NULL
//函数作用:NULL
//备注:NULL
/*****************************************************************/
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
3、重启VS
4、输入jude,按table键弹出来来定义的注释片段
ps:只支持vs2010以上【不包含vs2010】
二、使用小番茄
1、安装小番茄,VA
2、打开vs,VASSISTX-》Insert VA Snippet-》Edit VA Snippets
title:jude
shortcut:jude
内容:
/*****************************************************************/
//作者:朱小勇
//函数名称:NULL
//函数参数:NULL
//函数返回值:NULL
//函数作用:NULL
//备注:NULL
/*****************************************************************/
ps:最后加两个回车