Vim plugin to make centered headings:
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'
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
};
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)
Written in 2019 by Eddie Antonio Santos.