
新建工程后,依次打开 工具>>代码段管理器>>选择C++>>点击 添加(A)…按钮 ,设置你的代码块的目录
复制以下代码并存为note.snippet
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>note</Title> <Shortcut>note</Shortcut> <Description>note的代码片段</Description> <Author>陈创录</Author> <SnippetTypes> <SnippetType>Expansion</SnippetType> <SnippetType>SurroundsWith</SnippetType> </SnippetTypes> </Header> <Snippet> <Declarations> <Literal> <ID>FunctionName</ID> <ToolTip>函数名</ToolTip> <Default>函数名</Default> </Literal> <Literal> <ID>Description</ID> <ToolTip>方法描述</ToolTip> <Default>描述</Default> </Literal> <Literal> <ID>Parameters</ID> <ToolTip>参数列表</ToolTip> <Default>1</Default> </Literal> <Literal> <ID>Return</ID> <ToolTip>返回值</ToolTip> <Default>2</Default> </Literal> <Literal> <ID>Author</ID> <ToolTip>作者</ToolTip> <Default>Yourname</Default> </Literal> <Literal> <ID>Date</ID> <ToolTip>日期</ToolTip> <Default>2018-01-01</Default> </Literal> </Declarations> <Code Language="cpp"> <![CDATA[ /********************************************** * FunctionName: $FunctionName$ * Description: $Description$ * In Parameters: * $Parameters$ * Out Parameters: * $Return$ * @Author:$Author$ * @CreateDate:$Date$ **********************************************/ void $FunctionName$() //$Description$ { $selected$ $end$ } ]]> </Code> </Snippet> </CodeSnippet> </CodeSnippets>
|
在VS的代码编辑器里输入note后按tab即可。
近期评论