Skip to content

eddieantonio/vim-center

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-center

Build Status

Vim plugin to make centered headings:

Demo of using vim-center

Install

Use your favourite package manager:

git clone https://github.com/eddieantonio/vim-center ~/.vim/bundle/vim-center
Plug 'eddieantonio/vim-center'
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.

Releases

No releases published

Packages

No packages published