1024programmer Asp.Net Visual Studio sets shortcut snippets

Visual Studio sets shortcut snippets

Visual Studio sets shortcut code snippet

What is a shortcut code segment:
For example: Just enter mst and press TAB to automatically generate the code memset(str, 0, sizeof(str));, just enter Pow to automatically generate a quick code segment. Power functions, etc. are very convenient and fast, which improves the efficiency of writing code to a certain extent

How to set a custom code segment in Visual Studio:
① Create a new file XXX.snippet, where “XXX” is the above-mentioned “Pow” and “mst”, which is the abbreviation of the code segment

②Copy the following code (I don’t know if different versions of VS are the same. If they are different, you can go to Tools-Shortcut Code Segment to find the ready-made one, and then modify it)

<?xml version="1.0" encoding="utf-8"?>
 <CodeSnippets xmlns="http:/  /schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
     <CodeSnippet Format="1.0.0  ">
         
Res Res Structure code segment Bycds Expansion SurroundsWith
index i Index max length Maximum length <Code Language="cpp"> <![CDATA[typedef struct Res //Enter the code you want to quickly generate here { int x, y ; bool operator span> < (const Res &b) const { if(x< b.x) return 1 span>; return 0 span>; } }Res; Res s[200005];]]>

③Enter the code segment you need in the CODE location, and be sure to modify the Title to be consistent with your file name

④Add your own code snippet

Then select the .snippet file you created

⑤Restart VS and get it done

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/visual-studio-sets-shortcut-snippets/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索