All Projects → snipsnapdev → Snipsnap

snipsnapdev / Snipsnap

Licence: mit
The ultimate snippets collection for VS Code

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Snipsnap

Vscode Es7 Javascript React Snippets
Extension for Javascript/React snippets with search supporting ES7 and babel features
Stars: ✭ 435 (-48.21%)
Mutual labels:  vscode, snippets, extension
Vscode Vlang
V Language extension for Visual Studio Code.
Stars: ✭ 190 (-77.38%)
Mutual labels:  vscode, snippets, extension
Frontend Vscode Extensionpack
(820+ Users) Handpicked collection of vscode extensions for FE development. Get the extension @ https://marketplace.visualstudio.com/items?itemName=solodynamo.frontend-vscode-extensionpack
Stars: ✭ 329 (-60.83%)
Mutual labels:  vscode, extension
Openvsx
An open-source registry for VS Code extensions
Stars: ✭ 344 (-59.05%)
Mutual labels:  vscode, extension
Vscode Unity Code Snippets
All snippets for Unity3D development
Stars: ✭ 26 (-96.9%)
Mutual labels:  vscode, snippets
Vue Vscode Extensionpack
The extensions I use when developing a Vue application with VS Code
Stars: ✭ 264 (-68.57%)
Mutual labels:  vscode, extension
Graphql For Vscode
GraphQL syntax highlighting, linting, auto-complete, and more!
Stars: ✭ 265 (-68.45%)
Mutual labels:  vscode, snippets
Bracketpair
Bracket Colorizer Extension for VSCode
Stars: ✭ 374 (-55.48%)
Mutual labels:  vscode, extension
vscode-odoo-snippets
Develop Odoo modules faster and with no Typing Errors.
Stars: ✭ 20 (-97.62%)
Mutual labels:  snippets, extension
Vscode R
R Extension for Visual Studio Code (execution, snippet, lint, R documantation, R Markdown)
Stars: ✭ 445 (-47.02%)
Mutual labels:  vscode, snippets
Vscode Angular Snippets
Angular Snippets for VS Code
Stars: ✭ 530 (-36.9%)
Mutual labels:  vscode, snippets
root-file-viewer
View ROOT files directly in VS Code!
Stars: ✭ 20 (-97.62%)
Mutual labels:  extension, vscode
vscode-note
a simple note-taking extension for vscode.
Stars: ✭ 29 (-96.55%)
Mutual labels:  extension, vscode
Vscode Cordova
A Visual Studio Code extension providing intellisense, debug, and build support for Cordova and Ionic projects.
Stars: ✭ 267 (-68.21%)
Mutual labels:  vscode, extension
vscode-save-and-run
Visual Studio Code extension to run commands whenever a file is saved https://marketplace.visualstudio.com/items?itemName=wk-j.save-and-run
Stars: ✭ 31 (-96.31%)
Mutual labels:  extension, vscode
Vscode Vuehelper
🐵vscode插件,vue,vue-router和vuex的代码提示
Stars: ✭ 351 (-58.21%)
Mutual labels:  vscode, snippets
Polacode
📸 Polaroid for your code
Stars: ✭ 6,511 (+675.12%)
Mutual labels:  vscode, snippets
VscOdooSnippets
Odoo Snippets for Visual Studio Code
Stars: ✭ 29 (-96.55%)
Mutual labels:  snippets, extension
vscode-react-javascript-snippets
Extension for React/Javascript snippets with search supporting ES7+ and babel features
Stars: ✭ 782 (-6.9%)
Mutual labels:  snippets, extension
Amvim For Vscode
The Vim mode for Visual Studio Code(vscode) that works as expected.
Stars: ✭ 393 (-53.21%)
Mutual labels:  vscode, extension

Snipsnap Logo

Snipsnap

The ultimate snippets collection and VS Code extension that automatically exposes all available snippets for every library you are using in your project.

Install for VS Code

VS Code Marketplace VS Code Marketplace Downloads

out

Popular snippets

See the full list of supported libraries


Table of Contents

🔥 What problem Snipsnap is trying to solve?

Problem #1

Almost every popular language has a lot of different libraries that people used to use. Some of them big, others small. For each library you should keep in mind a lot of different syntax constructions in order to use them. Code snippets help to fix it, but you don't want to create or install extensions for each small library. Instead of it we want to have single Snipsnap extension that will fetch relevant code snippets based on languages, packages you use in your current project.

Problem #2

Different snippets extensions follow different rules and use unpredictable shortcuts such as "rccp", "ecrp", 'impp', etc. Having those unreadable shortcuts don't allow you to actually search across all snippets you have for a specific case. We want to change it by standardizing snippets format and providing clean, predictable search syntax such as library-name keyword, so you can always type name of your library and get full list of snippets available for it.

Problem #3

Each IDE has individual snippet formats that are not compatible with other IDEs. So having independent snippet formats would allow us to create Snipsnap extensions for each of the popular IDEs and using converters transform snippets from one format to another.

🛠️ How it works

Snipsnap VS Code extension scans your package.json (or yarn.lock) and searches on the server available snippets for packages you have in the project. It means that you don't need to install different extensions with snippets for frameworks, or libraries you use anymore.

Snipsnap extension creates snipsnap.code-snippets inside .vscode folder with all snippets, so snippets will be available even for other developers who did not install extension.

Snipsnap scans for new available snippets:

  • on folder opening
  • on pressing command "Snipsnap: Fetch the snippets" via the command palette

All snippets currently present in this repository and follow the guidelines described below.

🗓️ Our plans and vision

The current version could be called MVP and it's there just for the one purpose – test the idea and get first feedbacks. If you like extension - star the repository, tell us about your experience or help us to improve the project.

We don't want to stop just on having snippets for Javascript. We want to make it standard for all popular languages and their package managers. So cover Ruby, Go, Python, PHP libraries also in our plans.

We believe that snippets could become a perfect solution for providing simple documentation and examples. Code snippets should become the part of packages repositories like README files. You build your library, you put snippets together with it in .snipsnap.json file and then we fetch it.

Having standardized collection could allow us to write extensions and converters for all popular IDE's, that will finally make code snippets independent from IDE. Let's say in a couple of years the new awesome IDE will be released, instead of writing a whole batch of snippets for new IDE you will be able to just continue using Snipsnap and the collection you already created.

😇 Contributing

We encourage you to contribute to Snipsnap. Only with your help we can build really amazing collection of snippets that adapts to your needs.

🙏 Don't write same code twice, create snippet instead.

  1. Fork the project.
  2. If you add snippets for a new library - create folder inside snippets/javascript with the library name. Put inside that folder json file with your snippets. JSON file and folder name should be exactly the same as NPM package name, otherwise it won't work. If you update snippets, just find the right collection in the folder based on your library name and modify it.
  3. Create your snippets by using the described format.
  4. Test your snippets in your real or test project by putting a file test.code-snippets inside .vscode folder. VS Code automaticaly will fetch those snippets so you can start use them.
  5. Validate you snippets by running npx snipsnapdev/snipsnap-importer validate from your cloned snipsnap repository folder.
  6. Create PR.

🧬 Snippets Format

Snipsnap uses VS Code compatible snippet format, but has more strict rules to keep consistency across various libraries.

Code snippet example:

{
  "prop-types-import": {
    "prefix": ["prop-types import", "impt"],
    "body": ["import PropTypes from 'prop-types'"],
    "scope": "javascript,javascriptreact"
  }
}

key – keywords that represent as better as possible the content of the snippet. Must be in kebab-case,lowercased. For example: prop-types-import".

prefix – defines one or more trigger words which display the snippet in IntelliSense. Substring matching is performed on prefixes, so in this case, "fc" could match "for-const". Must be array of lowercased strings. The first prefix should have the format "{package-name} {keywords}", for example: "prop-types import", "react component arrow function". It used for better user experience since it allows you to search across snippets without knowing exact shortcut. Next prefixes should be lowercased.

body – is one or more lines of content, which will be joined as multiple lines upon insertion. Newlines and embedded tabs will be formatted according to the context in which the snippet is inserted. Must be array of strings.

scope - defines in which files the snippets will be available. Must be string with commaseparated language handlers. You could find them in VS Code Preferences -> User Snippets.

description - it's an optional field, but put there any information that could help you. Check examples of description for lodash or react-intersection-observer.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].