Licenses


Ⅰ. 插件描述

Vim Plugin that Provides Commands to Add Licenses at the Top of the Buffer

Ⅱ. 基本信息

创建日期:  2014-02-23
使用用户:  35
Github星:  50
插件作者:  Antoni Boucher

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'antoyo/licenses'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'antoyo/licenses'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'antoyo/licenses'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/antoyo/vim-licenses

Ⅳ. 文档说明

vim-licenses

[Vim Plugin][] that Provides Commands to Add Licenses at the Top of the Buffer

Description

This plugin provides commands to insert licenses at the top of the buffer.
If the license is already at the top of the buffer, nothing is added.
This plugin works for the most popular programming languages, including
C, Java, Objective-C, C++, C#, PHP, Python, JavaScript, Ruby, Perl, Asm and Haskell.
The HTML and CSS languages are also supported.
It may work for other languages.

There are currently more than 10 licenses, and you can add your own.
To do so, copy the license text in ~/.vim/licenses/licenseFile.txt.
Then add a command for this license:

command! License call InsertLicense('licenseFile')

If your license file contains a <year> tag, it will be automatically
replaced by the current year.

The <name of copyright holder> tag will be automatically replaced by the
content of the g:licenses_copyright_holders_name variable (if not empty), so that
the copyright holder's name will be automatically added to the license.
Thus, you may want to add such a line to you .vimrc:

let g:licenses_copyright_holders_name = 'Last Name, First Name <my@email.com>'

And the <name of author> tag will be automatically replaced by the the
content of the g:licenses_authors_name variable (if not empty), so that
your name will be automatically added to the license.
Thus, you may want to add such a line to you .vimrc:

let g:licenses_authors_name = 'Last Name, First Name <my@email.com>'

If you do not want this plugin to create all these commands, you may
restrict to the licenses you want by using the g:licenses_default_commands

  1. For instance, to have this plugin add only a command for the GNU GPL,
    Mit and Foobar licenses, use this:
let g:licenses_default_commands = ['gpl', 'mit', 'foobar']

Commands

:Affero

Add the GNU Affero license to the buffer.

:Allpermissive

Add the GNU All-Permissive license to the buffer.

:Apache

Add the Apache License 2.0 to the buffer.

:Boost

Add the Boost software license 1.0 to the buffer.

:Bsd2

Add the BSD 2-Clause "New" or "Revised" license to the buffer.

:Bsd3

Add the BSD 3-Clause "Simplified" or "FreeBSD" license to the buffer.

:Cc0

Add the Creative Commons Zero license to the buffer.

:Ccby

Add the Creative Commons Attribution 4.0 International License to the buffer.

:Ccbysa

Add the Creative Commons Attribution-ShareAlike 4.0 International License to
the buffer.

:Cecill

Add the CeCILL license to the buffer.

:Epl

Add the Eclipse Public License to the buffer.

:Gfdl

Add the GNU Free Documentation License (FDL) to the buffer.

:Gpl

Add the GNU General Public License (GPL) version 3.0 to the buffer.

:Gplv2

Add the GNU General Public License (GPL) version 2.0 to the buffer.

:Isc

Add the ISC license to the buffer.

:Lgpl

Add the GNU "Lesser" General Public License (LGPL) license to the buffer.

:Mit

Add the MIT license to the buffer.

:Mitapache

Add the MIT/Apache Licence 2.0 dual license to the buffer.

:Mpl

Add the Mozilla Public License 2.0 to the buffer.

:Uiuc

Add the University of Illinois/NCSA Open Source License (UIUC) to the buffer.

:Unlicense

Add the Unlicense to the buffer.

:Verbatim

Add the GNU Verbatim Copying License to the buffer.

:Wtfpl

Add the Do What The Fuck You Want To Public License (WTFPL) to the buffer.

:Zlib

Add the Zlib License to the buffer.

Settings

g:licenses_authors_name option

The name of author to automatically insert in the buffer in the licence.

let g:licenses_authors_name = 'Last Name, First Name <my@email.com>'

g:licenses_default_commands

Choose what commands to create for the listed licenses

let g:licenses_default_commands = ['gpl', 'mit', 'foobar']

By default, only :Gpl and :Mit commands are available. :Foobar is also created for licenses/foobar.txt.

添加新评论