#vim-header Easily adds brief author info and license headers
Preferred installation method is Pathogen
cd ~/.vim/bundle
git clone https://github.com/alpertuna/vim-header
Or 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: 13.03.2016
or for a file named index.php
<?php
/*
* File: index.php
* @author: Your Name <your@mail>
* Date: 13.03.2016
* Last Modified: 13.03.2016
*/
Adding Brief Headers
:AddHeader
Adds brief author information or updates if exists:AddMinHeader
Adds minified version of author information
Adding Lincenses
:AddMITLicense
Adds MIT License with author info:AddApacheLicense
Adds Apache License with author info:AddGNULicense
Adds GNU License with author info
These settings are for your .vimrc
let g:header_field_filename = 0
It 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 = 0
It disables to add creating date line. Default is 1.
let g:header_field_modified_timestamp = 0
It disables to add modified date line. Default is 1.
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 = 0
It 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
- ocaml
- php
- perl
- plaintex
- 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.
###Thanks to Contributors Contributors List