Easily adds brief author info and license headers
Preferred installation method is Pathogen
cd ~/.vim/bundle
git clone https://github.com/alpertuna/vim-headerOr you can use your own way
This is a general usage example.
You can add these lines into your .vimrc
let g:header_field_author = 'Your Name'
let g:header_field_author_email = 'your@mail'
map <F4> :AddHeader<CR>Pressing F4 in normal mode will add a brief author information at the top of your buffer.
For example, when you open a file named start.sh and press F4 after above settings, plugin will add these lines at the top of your buffer
#!/bin/bash
# File: start.sh
# Author: Your Name <your@mail>
# Date: 13.03.2016
# Last Modified Date: 13.03.2016
# Last Modified By: Your Name <your@mail>or for a file named index.php
<?php
/*
* File: index.php
* @author: Your Name <your@mail>
* Date: 13.03.2016
* Last Modified Date: 13.03.2016
* Last Modified By: Your Name <your@mail>
*/Adding Brief Headers
:AddHeaderAdds brief author information or updates if exists:AddMinHeaderAdds minified version of author information
Adding Lincenses
:AddMITLicenseAdds MIT License with author info:AddApacheLicenseAdds Apache License with author info:AddGNULicenseAdds GNU License with author info
These settings are for your .vimrc
let g:header_field_filename = 0It disables to add filename line in header. Default is 1.
let g:header_field_author = 'Your Name'It adds your name as author. Default is ''. Empty string means to disable adding it.
let g:header_field_author_email = 'your@mail'It adds your email after author name with surrounding < > chars. If you don't define your author name, defined email also won't be shown. Default is ''. Empty string means to disable adding it.
let g:header_field_timestamp = 0It disables to add creating date line. Default is 1.
let g:header_field_modified_timestamp = 0It disables to add modified date line. Default is 1.
let g:header_field_modified_by = 0It disables to add modified author line. Default is 1. Likewise the author name line, if you don't define your author name, this line won't be shown. If your email is defined together with your name, your email will be appended after your author name.
let g:header_field_timestamp_format = '%d.%m.%Y'It sets timestamp format for your locale. Default is '%d.%m.%Y'.
let g:header_auto_add_header = 0It disables to add header automatically. Default is 1.
Supported filetypes are;
- asm
- c
- clojure
- cpp
- cs
- css
- elixir
- erlang
- go
- groovy
- haskel
- java
- javascript
- jsx
- lisp
- lua
- matlab/octave
- ocaml
- php
- perl
- plaintex
- pug
- python
- ruby
- sass
- scala
- scheme
- sh
- tmux
- vim
- xdefaults
And licenses are;
- MIT
- Apache
- GNU
If you want more filetypes or licenses, you can open issues or provide any improvements by pull requests on alpertuna/vim-header. Also you can correct my English on README file or at comments in source code.