Header Ads

Header ADS

Configure User Snippets



🔧 Step-by-step: Custom Snippet Setup in VS Code

🔹 1. VS Code-এ গিয়ে Command Palette খুলো:

Ctrl + Shift + P (Windows/Linux)
Cmd + Shift + P (Mac)


🔹 2. টাইপ করো:

Preferences: Configure User Snippets

এটা সিলেক্ট করো।


🔹 3. এরপর:

  • তোমার ভাষা অনুযায়ী snippet বানাও (যেমন javascript.json, html.json, etc.)

  • অথবা নিচে “New Global Snippets file” ক্লিক করে একেবারে গ্লোবালি snippet add করতে পারো।


🔹 4. ধরো তুমি html.json এ নিচের মতো একটা snippet add করলে:

{
  "My Template": {
    "prefix": "temp",
    "body": [
      "<!DOCTYPE html>",
      "<html lang=\"en\">",
      "<head>",
      "    <meta charset=\"UTF-8\">",
      "    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
      "    <title>Document</title>",
      "</head>",
      "<body>",
      "",
      "</body>",
      "</html>"
    ],
    "description": "Basic HTML5 template"
  }
}

Final Snippet JSON: (for VS Code)


{ "My Node.js Initial Template": { "prefix": "temp", "body": [ "// initial code ", "", "\"use strict\";", "console.clear();", "", "// Starts The Main Code : ", "", "// Require All The Modules , Packages And Objects : ", "", "", "// Connect With Server : ", "", "", "// Request-Response-Cycle : ", "", "", "// Exports Code :" ], "description": "My initial Node.js file structure" } }

🔹 5. এখন VS Code-এ নতুন .html ফাইলে গিয়ে temp লিখলে এমন আসবে:

💡 temp → My Template (Basic HTML5 template)

Enter চাপলেই পুরো HTML5 template paste হয়ে যাবে!


📝 Snippet Structure Recap

Key Description
   prefix তুমি যেটা লিখবে (trigger word, eg: temp)
   body যেটা paste হবে (template content)
 description   suggestion hint হিসেবে দেখাবে


Powered by Blogger.