From 5e4cf24d954cb720dde87ca8f4ce013060d9ae24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Fri, 10 Jul 2026 16:14:42 +0200 Subject: [PATCH] Add Vim documentation for licenser plugin Add comprehensive help documentation including: - Introduction and overview - Usage of :Licenser command - Configuration options (g:licenser_author) - Complete list of supported filetypes - Complete list of supported licenses - Usage examples Documentation follows standard Vim help format and can be accessed with :help licenser once the plugin is installed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- doc/licenser.txt | 135 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 doc/licenser.txt diff --git a/doc/licenser.txt b/doc/licenser.txt new file mode 100644 index 0000000..e9953e4 --- /dev/null +++ b/doc/licenser.txt @@ -0,0 +1,135 @@ +*licenser.txt* A plugin for adding license headers to source code files + + +CONTENTS *licenser-contents* + + 1. Introduction ...................... |licenser-introduction| + 2. Usage ............................ |licenser-usage| + 3. Configuration .................... |licenser-configuration| + 4. Supported Filetypes .............. |licenser-filetypes| + 5. Supported Licenses ............... |licenser-licenses| + 6. Examples ......................... |licenser-examples| + + +INTRODUCTION *licenser-introduction* + +vim-licenser is a Vim plugin that makes it easy to add license headers to your +source code files. It supports multiple programming languages and a wide variety +of open-source licenses. + +The plugin automatically applies the correct comment style based on the file type +and inserts the license text with proper formatting. + + +USAGE *licenser-usage* + + *:Licenser* +:Licenser {license} + + Add a license header to the current file. The {license} parameter should be + the name of one of the supported licenses (see |licenser-licenses|). + + Examples: + :Licenser MIT + :Licenser Apache2 + :Licenser GPLv3 + + The license will be inserted at the beginning of the file, respecting any + existing hashbang line (e.g., #!/bin/bash). The current year and author + name are automatically substituted into the license text. + + +CONFIGURATION *licenser-configuration* + + *g:licenser_author* + +Set the author name to be used in license headers. If not set, defaults to +"Author Name". + + let g:licenser_author = "Your Name" + +Example: > + let g:licenser_author = "John Doe" +< + +SUPPORTED FILETYPES *licenser-filetypes* + +vim-licenser supports the following filetypes with appropriate comment styles: + + bash - Shell script + c - C language + cpp - C++ + csharp - C# + css - Cascading Style Sheets + dart - Dart + go - Go + groovy - Groovy + haskell - Haskell + html - HTML + java - Java + javascript - JavaScript + json - JSON + kotlin - Kotlin + lua - Lua + matlab - MATLAB + perl - Perl + php - PHP + python - Python + r - R + ruby - Ruby + rust - Rust + scala - Scala + shell - Shell script + sql - SQL + swift - Swift + typescript - TypeScript + typescriptreact - TypeScript React (TSX) + vim - Vim script + xml - XML + yaml - YAML + +If your filetype is not in this list, vim-licenser will display an error message. + + +SUPPORTED LICENSES *licenser-licenses* + +vim-licenser includes license templates for the following licenses: + + AGPL - GNU Affero General Public License v3 + Apache2 - Apache License 2.0 + BSD2 - BSD 2-Clause License + BSD3 - BSD 3-Clause License + GPL - GNU General Public License v3 + GPLv2 - GNU General Public License v2 + ISC - ISC License + LGPL - GNU Lesser General Public License v3 + MIT - MIT License + MIT0 - MIT No Attribution License (0-Clause MIT) + MPL2 - Mozilla Public License v2.0 + Unlicense - Unlicense (public domain) + Zlib - Zlib License + +Tab completion is available for license names. Simply type `:Licenser ` to +see all available licenses. + + +EXAMPLES *licenser-examples* + +Add an MIT license to a Python file: > + :Licenser MIT + +Add an Apache 2.0 license to a JavaScript file: > + :Licenser Apache2 + +Add a GPL v3 license to a Rust file: > + :Licenser GPL + +The license will be inserted with the correct comment style for the file type. +For Python, this means using # comments. For Rust, it uses /* */ block comments. + +The YEAR placeholder in the license text will be replaced with the current year, +and the AUTHOR placeholder will be replaced with the value of |g:licenser_author|. + + +============================================================================== +vim:tw=78:ts=8:ft=help:norl: