center-text.vim is all about formating comments. The plugin provides mappings to easily center comments padded with most punctuation chars.
It's easiest to explain with examples.
In a Javascript file press \fch
inside
// some comment
to change it to
// some comment //
In a bash file press \fch-
inside
# some comment
to change it to
# ------------------------------- some comment ------------------------------- #
In a vim file press \fch*
inside
" some comment
to change it to
" ******************************* some comment ******************************* "
This plugin is great for breaking files into sections.
- Add
Plug 'jtbairdsr/vim-center-comment'
to your vimrc file. - Reload your vimrc or restart
- Run
:PlugInstall
Vundle or similar
- Add
Plugin 'jtbairdsr/vim-center-comment'
to your vimrc file. - Reload your vimrc or restart
- Run
:BundleInstall
- Add
NeoBundle 'jtbairdsr/vim-center-comment'
to your vimrc file. - Reload your vimrc or restart
- Run
:NeoUpdate
cd ~/.vim/bundle
git clone https://github.com/jtbairdsr/vim-center-comment.git
(For Neovim, change ~/.vim/
to ~/.config/nvim/
.)
curl -fLo ~/.vim/plugin/center-comment.vim --create-dirs \
https://raw.githubusercontent.com/jtbairdsr/center-comment/master/plugin/center-comment.vim
curl -fLo ~/.vim/doc/center-comment.txt --create-dirs \
https://raw.githubusercontent.com/jtbairdsr/center-comment/master/doc/center-comment.txt
md ~\vimfiles\plugin
md ~\vimfiles\doc
$pluguri = 'https://raw.githubusercontent.com/jtbairdsr/center-comment/master/plugin/center-comment.vim'
$docsuri = 'https://raw.githubusercontent.com/jtbairdsr/center-comment/master/doc/center-comment.txt'
(New-Object Net.WebClient).DownloadFile($pluguri, $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("~\vimfiles\plugin\center-comment.vim"))
(New-Object Net.WebClient).DownloadFile($docsuri, $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("~\vimfiles\doc\center-comment.txt"))
Once help tags have been generated, you can view the manual with
:help center-comment
.
Copyright (c) Jonathan Baird. Distributed under the same terms as Vim itself.
See :help license
.