The Vscode Add Signature extension automatically adds a preloaded signature to the top of each file whenever a new file is created. Users can configure the signature text through the extension settings.
The extension is activated when Visual Studio Code starts. It listens for the creation of new files using vscode file explorer and generate signature text.
Use shortcut cmd + shift + g
in mac or ctrl + shift + g
to generate signature manually in opened file.
OR
Open vscode Command Pallet by pressing cmd + shift + p
in mac or ctrl + shift + p
in window. Search VscodeAddSignature: Add Signature
and press enter.
Note: Signature will be added for supported file types only if extension is enabled from extension setting.
For Keybinding Conflict please refer Detecting keybinding conflicts
- Open vscode Command Pallet by pressing
cmd + shift + p
in mac orctrl + shift + p
in window. - Search
VscodeAddSignature: Configure
and open extension setting.
Configure the extension through the following settings:
- Enable Add Signature: Toggle to enable/disable adding the signature text to new files.
- Signature Text: Enter the signature text to be added at the top of each new file. For new line in comment use
Enter
.
Note: To use new line without *
press Enter
and start typing. See Example 2
.js
.ts
.rb
.rs
.php
.java
.kt
.kts
.c
.html
.css
.py
Here's an example of how to format the signature text:
Input
* author Saquib Shaikh
* created on ${DD-MM-YYYY-hh-mm}
* github: https://github.com/saquibshaikh14
* copyright ${YEAR}
File output
javascript & typescript
/**
* author Saquib Shaikh
* created on 16-03-2024-10-30
* github: https://github.com/saquibshaikh14
* copyright 2024
**/
html
<!--
* author Saquib Shaikh
* created on 02-05-2024-17h-50m
* github: https://github.com/saquibshaikh14
* copyright 2024
-->
Input
author Saquib Shaikh
created on ${DD-MM-YYYY-hh-mm}
github: https://github.com/saquibshaikh14
copyright ${YEAR}
File output
javascript & typescript
/**
author Saquib Shaikh
created on 16-03-2024-10-30
github: https://github.com/saquibshaikh14
copyright 2024
**/
html
<!--
author Saquib Shaikh
created on 02-05-2024-17h-50m
github: https://github.com/saquibshaikh14
copyright 2024
-->
To contribute to the development of this extension or report any issues, visit the GitHub repository. Feel free to raise issues, submit pull requests, or contribute in any way you see fit.
The extension handles the following file-related operations:
- onDidCreateFiles: Listens for the creation of new files and adds the signature text to them.
- addSignatureToFile: Adds the configured signature text to the top of each new file.
The extension's deactivate function is called when the extension is deactivated. However, since the extension primarily operates based on events triggered by file creation, there is no specific deactivation logic implemented.
- Name: Saquib Shaikh
- Email: mdsqb0786@gmail.com
Feel free to modify or enhance this extension as needed. Your contributions are welcome!