Ⅰ. 插件描述
License your code from Vim like a secret agentⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'ararslan/license-to-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'ararslan/license-to-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'ararslan/license-to-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/ararslan/license-to-vim
Ⅳ. 文档说明
# license-to-vim
This is a simple Vim plugin that gives you the license to license your code.
You can insert a license right into your code without leaving Vim!
The table below lists all licenses currently available in this plugin, as well as the abbreviation used by the plugin and whether the license suggests adding a stub.
| License | Abbreviation | Stub |
|---|---|---|
| GNU Affero General Public License 3.0 | agpl | Yes |
| Apache License 2.0 | apache | Yes |
| Artistic License 2.0 | artistic | No |
| Beerware License 42 | beer | No |
| Blue Oak Model License 1.0 | blue-oak | No |
| Boost Software License 1.0 | boost | No |
| BSD 2-Clause License | bsd-2 | No |
| BSD 3-Clause License | bsd-3 | No |
| CC0 1.0 | cc0 | Yes |
| Eclipse Public License 1.0 | epl | No |
| European Union Public License 1.2 (EN) | eupl | No |
| GNU General Public License 2.0 | gpl-2 | Yes |
| GNU General Public License 3.0 | gpl-3 | Yes |
| ISC License | isc | No |
| GNU Lesser General Public License 2.1 | lgpl-2 | Yes |
| GNU Lesser General Public License 3.0 | lgpl-3 | Yes |
| MIT License | mit | No |
| Mozilla Public License 2.0 | mpl | No |
| Microsoft Public License | ms-pl | No |
| Microsoft Reciprocal License | ms-rl | No |
| University of Illinois/NCSA Open Source License | uiuc | No |
| Unlicense | unlicense | No |
| Do What The Fuck You Want To Public License | wtf | No |
Don't see the license you want?
Open an issue and I'd be happy to add it.
To insert the full text of a license at the top of the file, enter :License('abbr'), where abbr refers to the abbreviation in the table.
Some licenses require that license stubs be inserted at the top of files.
(See the Stub column in the table.)
For applicable licenses, you can get the stub using :Stub('abbr').
Calling :Stub on licenses without an available stub causes an error.
Some licenses and stubs require a year, author, and/or email address.
This plugin automatically populates those for you!
The year always uses the current year, but to set your name and email address, add these lines to your .vimrc or equivalent:
let g:license_author = 'Rick Astley'
let g:license_email = 'rickroll@example.com'Though, unless you happen to be Rick Astley, you should use your own information.
You don't need to set these values; if the variables aren't set, the author and email in the inserted license text will appear as {AUTHOR} and {EMAIL}, respectively.
Installation
If you don't have a preferred installation method, I recommend installing Vim Plug.
Then just add
Plug 'ararslan/license-to-vim'to your .vimrc or equivalent and submit :source % then :PlugInstall.
License
Copyright (C) 2016, Alex Arslan. Distributed under the same terms as Vim itself. See :help license.