MetaHeader is a Visual Studio Code extension that automatically generates a header template for your code files. This header includes the author name, date, time, and day of creation, formatted according to the file type's comment syntax.
MetaHeader is designed to help you maintain consistency in your code files by automatically adding a standardized header. This can be especially useful for large projects with multiple contributors, ensuring that each file includes essential metadata.
What is it for?
MetaHeader helps you:
- Automatically insert a header with author information and file creation date/time.
- Customize the header content based on user preferences.
- Maintain consistency across various file types with proper comment syntax.
Supported Languages
MetaHeader supports a wide range of programming languages. Here are the currently supported file extensions and their corresponding comment syntax:
- Python (.py)
- JavaScript (.js)
- TypeScript (.ts)
- Java (.java)
- C (.c)
- C++ (.cpp)
- C# (.cs)
- Go (.go)
- Ruby (.rb)
- PHP (.php)
- HTML (.html)
- CSS (.css)
- SCSS (.scss)
- Sass (.sass)
- Less (.less)
- Shell Script (.sh)
- Batch (.bat)
- PowerShell (.ps1)
- Rust (.rs)
- Swift (.swift)
- Kotlin (.kt)
- Scala (.scala)
- Lua (.lua)
- R (.r)
- Perl (.pl, .pm)
- Erlang (.erl)
- Elixir (.ex, .exs)
- SQL (.sql)
Follow these steps to use MetaHeader in VS Code:
Install the Extension:
- Go to the Extensions view (
Ctrl+Shift+X
or Cmd+Shift+X
on Mac).
- Search for "MetaHeader" and click "Install".
Insert Header:
- Open a file in the supported languages list.
- Press
Ctrl+Alt+I
(Windows/Linux) or Cmd+Alt+I
(Mac) to insert the header.
- Alternatively, you can use the command palette (
Ctrl+Shift+P
or Cmd+Shift+P
on Mac), type "Insert Header", and select the command.
Edit Header Configurations:
- To edit the header content preferences, press
Ctrl+Alt+E
(Windows/Linux) or Cmd+Alt+E
(Mac).
- This allows you to customize which elements (date, time, seconds, day) are included in the header.
Edit Author Name:
- To update the author name, press
Ctrl+Alt+A
(Windows/Linux) or Cmd+Alt+A
(Mac).
- You will be prompted to enter a new author name, which will be saved and used for future headers.
Key Bindings
- Insert Header:
Ctrl+Alt+I
(Windows/Linux), Cmd+Alt+I
(Mac)
- Edit Header Configurations:
Ctrl+Alt+E
(Windows/Linux), Cmd+Alt+E
(Mac)
- Edit Author Name:
Ctrl+Alt+A
(Windows/Linux), Cmd+Alt+A
(Mac)
Python (.py)
# Author name: Aniruddha Salve
# Date: 26/05/2024
# Day: Sunday
CSS (.css)
/*
Author name: Aniruddha Salve
Date: 26/05/2024
Day: Sunday
*/
Contribution
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on GitHub.