Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snippets are awesome. Creating one is painful. This saves time. #81

Open
naquiuddin opened this issue Jun 7, 2019 · 0 comments
Open
Assignees
Labels
coolhack This trick is cool dailyhack This issue belongs to dailyhack.xyz tool This is issues is about the tool

Comments

@naquiuddin
Copy link
Collaborator

We sometimes write the same code multiple times. For example Configs (related to webpack bable, prettier, eslint etc), frequently used react component code and other boiler plate code.

Some of us store them in GitHub's Gists, but have to copy paste it when required. Snippets are handy shortcuts to generate code for us. For example if you type imp in VS Code's JavaScript file, it automatically creates import <some space> from '<cursor shows here>'. You can type the package name and then press tab to automatically move cursor to another step. Just try it yourself.

We can create our own custom snippets for frequently written code to increase productivity. However writing it is painful. So here is a handy tool that creates snippet for you.

This tool works for sublime, atom and VS Code. However I like VS Code so this one is mostly about it.

https://snippet-generator.app/

Just copy paste your code on left side. Add $1 for first tab, $2 for second tab and so on.
On the right side you will see snippets generated automatically for you.

After that Go to 'Preferences' > 'User snippets' and select the correct type, then paste in the copied code.
Discover more from the VS Code snippets docs.

@mddanishyusuf mddanishyusuf added coolhack This trick is cool dailyhack This issue belongs to dailyhack.xyz tool This is issues is about the tool labels Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coolhack This trick is cool dailyhack This issue belongs to dailyhack.xyz tool This is issues is about the tool
Projects
None yet
Development

No branches or pull requests

2 participants