Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 2.4 KB

README.md

File metadata and controls

42 lines (30 loc) · 2.4 KB

SSnippets

Content

  • About – why and how?
  • Quickstart – how to integrate SSnippets into your project.
  • Customization – how to customize SSnippets to your needs.
  • Account sync – how to sync SSnippets across multiple projects and devices.

About

SSnippets offers easily customizable snippets without unnecessary complexity.

Take whatever you need, paste it into your project and stop slowing VSCode down with hundreds of snippets you'll never use, from libraries you'll forget you even installed.

The project was created to:

  • Maintain a repository of snippets that can be split into parts and fully customized to your project's needs.
  • Make it easier to take your first steps in VSCode snippet creation.

Quickstart

To enable SSnippets simply copy files with types of snippets that you need to the .vscode directory of your project.

Customization

Since SSnippets is not a library, it is extremely easy to customize.

Simply open a .code-snippets file containing a snippet that you want to customize and adjust its properties to your needs.

What do all these properties mean? The important ones you should focus on are:

  • "prefix" – what you have to write in your editor for the snippet suggestion to appear (e.g. if you type ssref, VSCode will most likely suggest a snippet with name ss-useRef).
  • "body" – content of the snippet. This is where the magic happens (you can find more about snippet syntax here).
  • "scope" – what kind of files should the snippets be suggested in (e.g. "javascript,html" will cause the snippet to be suggested in .js and .html files).

Account-sync

To sync SSnippets across multiple projects and devices using the same account you first need to have your VSCode settings sync turned on.

Then:

  • Press ctrl+shift+p.
  • Look for an option Snippets: Configure snippets and select it.
  • Select a file type that you want to use the snippets for (eg. typescriptreact to enable snippets only in .tsx files).
  • Paste selected SSnippets to the JSON file and save it.