eddieantonio / vim-center

Center headings easily in vim!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vim-center

Build Status

Vim plugin to make centered headings:

Demo of using vim-center

Install

Use your favourite package manager:

Pathogen https://github.com/tpope/vim-pathogen

git clone https://github.com/eddieantonio/vim-center ~/.vim/bundle/vim-center

vim-plug https://github.com/gmarik/vundle

Plug 'eddieantonio/vim-center'

Vundle https://github.com/gmarik/vundle

Plugin 'eddieantonio/vim-center'

Commands

There is only one command: :CenterHeading

Write a heading in your buffer like this:

This is my heading

Then, in normal mode, type :CenterHeading and press enter:

########################## This is my heading ##########################

The delimiters are determined automatically by file type. Say I was writing code in C and I made a heading for constants:

Constants

enum {
    MY,
    WILD,
    ENUM
};

Use :CenterHeading while on the first line:

/***************************** Constants ******************************/

enum {
    MY,
    WILD,
    ENUM
};

Mappings

vim-center does not define any mappings by default, but :CenterHeading can be mapped by using <Plug>(center-heading). For example, I have this in my .vimrc:

noremap <Leader>ch <Plug>(center-heading)

Credits

Written in 2019 by Eddie Antonio Santos.

About

Center headings easily in vim!


Languages

Language:Vim Script 98.5%Language:Shell 1.5%