Custom Snippets for Visual Studio Code
Overview
This repository contains custom code snippets for Visual Studio Code (VSCode) to streamline your development process. These snippets are designed to enhance productivity by providing quick access to commonly used code patterns.
Installation
To use these snippets, follow these steps:
Clone or download this repository to your local machine.
Copy the snippet files (ending with .json
) into your VSCode snippets directory.
- Windows:
%APPDATA%\Code\User\snippets
- macOS:
~/Library/Application Support/Code/User/snippets
- Linux:
~/.config/Code/User/snippets
Restart VSCode for changes to take effect.
Snippets List
cl
- Log a message and an object to the console
console.log('$1', $2);
Use this snippet to quickly log a message and an object to the console.
cw
- Log a warning message and an object to the console
console.warn('$1', $2);
This snippet is useful for logging warning messages and an object to the console.
ce
- Log an error message and an object to the console
console.error('$1', $2);
This snippet helps in logging error messages and an object to the console.
console.info('$1', $2);
Use this snippet to log informational messages and an object to the console.
cd
- Log a debug message and an object to the console
console.debug('$1', $2);
This snippet assists in logging debug messages and an object to the console.
ca
- Log an assertion message and an object to the console
console.assert($1, $2);
Use this snippet to log assertion messages and an object to the console.
Usage
To insert a snippet into your code:
- Open a JavaScript or TypeScript file in VSCode.
- Type the snippet prefix (e.g.,
cl
or cw
).
- Press
Tab
to expand the snippet.
Contributing
Contributions are welcome! If you have any useful snippets to share or improvements to existing ones, feel free to open a pull request.
License
This project is licensed under the MIT License.