Skip to content

SaturnoSoftware/vscode-fancy-header

Repository files navigation

Saturno FancyHeader

latest release commits License: GPL-3.0 Tests: CI verified Platform

Insert consistent file headers with one command. Language-aware, configurable, and ready for real project templates.

Saturno FancyHeader is a VS Code extension that inserts structured file headers using the active language comment syntax plus file, project, date, and author metadata. It gives source files a clean, repeatable header without hand-written boilerplate.

Maintained by Saturno.Software.


Quick Start

Install from VSIX

code --install-extension saturno-fancy-header-1.1.2.vsix

Use

  1. Open a file in VS Code
  2. Open Command Palette (Ctrl+Shift+P)
  3. Run Saturno: Add Header

Header(SaturnFH)

Optional template commands:

  • Saturno: New Header Template
  • Saturno: Edit Header Templates

Default output:

// ------------------------------------------------------------------------------
//   File      : example.ts
//   Project   : my-project
//   Date      : 2026-05-31
//   Copyright : 2026
//   Copyright : Mateus <mateus@example.com>
// ------------------------------------------------------------------------------

Features

  • Language-Aware -- Uses the active VS Code language comment syntax automatically
  • Metadata-Driven -- Inserts file name, project name, date, and author information
  • Template-Based -- Supports inline template lines, external template files, and named template pickers
  • Command Palette Friendly -- Create, edit, and apply templates without leaving the editor
  • Cross-Platform -- Works on Windows, macOS, and Linux with platform-correct template paths
  • Zero Config -- Works out of the box with sensible defaults

Installation

From GitHub Release

Download the latest .vsix from Releases, then install it:

code --install-extension saturno-fancy-header-1.1.2.vsix

From Source

git clone https://github.com/SaturnoSoftware/vscode-fancy-header
cd vscode-fancy-header
git submodule update --init --recursive
npm install
npm run package
code --install-extension __DIST/*.vsix

Requirements

  • VS Code ^1.88.0

Configuration

All settings are available in the VS Code Settings UI under Saturno FancyHeader, or in settings.json.

Minimal template-file setup:

{
  "saturno-fancy-header.templateFile": "${workspaceFolder}/_header-template.txt"
}

If templateFile is set, FancyHeader reads the template body from that file and does not require templateLines to be configured as well.

Advanced overrides (optional):

{
  "saturno-fancy-header.lineWidth": 80,
  "saturno-fancy-header.fillChar": "-",
  "saturno-fancy-header.templateFile": "${workspaceFolder}/_header-template.txt",
  "saturno-fancy-header.authorName": "",
  "saturno-fancy-header.authorEmail": "",
  "saturno-fancy-header.templateLines": [
    "  File      : FILENAME",
    "  Project   : PROJECT",
    "  Date      : DATE",
    "  Copyright : YEAR",
    "  Copyright : USER_NAME <USER_EMAIL>"
  ]
}
Setting Default Description
lineWidth 80 Total width of generated header lines
fillChar "-" Border fill character
templateFile "" Optional external template file
templates [] Optional named template files shown in a picker
authorName "" Optional author name override
authorEmail "" Optional author email override
templateLines default list Inline template body with placeholders

Supported placeholders:

  • FILENAME
  • PROJECT
  • DATE
  • YEAR
  • USER_NAME
  • USER_EMAIL

Template File Example

Create _header-template.txt:

  File      : ${FILENAME}
  Project   : ${PROJECT}
  Date      : ${DATE}
  Author    : ${USER_NAME} <${USER_EMAIL}>

Then point templateFile to it.

FancyHeader also auto-discovers template files named _header-*.txt in the same template directory and in the default user template folder, so if you add a new file there it is picked up automatically in the template picker.

If you define templates, FancyHeader merges those named entries with the discovered files and opens a Quick Pick when more than one template is available.


Commands

Command Title Description
saturno-fancy-header.addHeader Saturno: Add Header Insert a header with the active template and language comment syntax
saturno-fancy-header.newTemplate Saturno: New Header Template Create a new template file, register it, and open it
saturno-fancy-header.editTemplates Saturno: Edit Header Templates Pick and open an existing template file

How It Works

FancyHeader reads VS Code language configuration to determine the correct line comment syntax for the active document, then fills the selected template with:

  • current file name
  • workspace or project name
  • current date and year
  • author name and email from settings, Git config, or local user information

Template selection follows this order:

  1. named template chosen from templates
  2. external file from templateFile
  3. inline templateLines

Local Development

git submodule update --init --recursive
npm install
npm test
npm run build
npm run package

Contributing

Contributions welcome! Please:

  • follow existing code style
  • add tests for new features
  • submit pull requests against main

License

GPL-3.0 -- See LICENSE.txt for details.

Maintained by Saturno.Software.


FAQ

Q: Does it work with different programming languages?
A: Yes. FancyHeader uses the active VS Code language comment syntax, so it works anywhere VS Code exposes a line-comment style.

Q: Can I use my own header template file?
A: Yes. Set saturno-fancy-header.templateFile to a text file, or configure multiple named templates with saturno-fancy-header.templates.

Q: Where do author name and email come from?
A: From the extension settings first, then Git config when available, then local user information as a fallback.

Q: How do I install without a marketplace listing?
A: Download or build the .vsix, then run code --install-extension path-to-file.vsix.


Links


Made with <3 by Saturno.Software

About

No description, website, or topics provided.

Resources

License

GPL-3.0, GPL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE.txt
GPL-3.0
COPYING.txt

Stars

Watchers

Forks

Packages

 
 
 

Contributors