Coder Social home page Coder Social logo

vim-header's Introduction

#vim-header Easily adds brief author info and license headers

Install

Preferred installation method is Pathogen

cd ~/.vim/bundle
git clone https://github.com/alpertuna/vim-header

Or you can use your own way

Usage

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.

Examples

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
# start.sh
# Author: Your Name <your@mail>
# Date: 13.03.2016

or for a file named index.php

<?php
/*
 * index.php
 * Author: Your Name <your@mail>
 * Date: 13.03.2016
 */

Commands

Adding Brief Headers

  • :AddHeader Adds brief author information
  • :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

Settings

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 timestamp line of generating header date in header. Default is 1.

let g:header_field_timestamp_format = '%d.%m.%Y'

It sets timestamp format for your locale. Default is '%d.%m.%Y'.

Support

Supported filetypes are;

  • c
  • cpp
  • css
  • groovy
  • haskel
  • java
  • javascript
  • jsx
  • lua
  • php
  • perl
  • python
  • sass
  • sh
  • vim

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

vim-header's People

Contributors

alpertuna avatar daixijun avatar excaliburzero avatar ouzhenkun avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.