jmurowaniecki / vim-header-composer

Make header boxes with comments "#" of any selected string in VIM with shortcut.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VIM Header Composer

StyleCI Codacy Version

VIM header composer is an utility script wrote in shell very simple to make header's based on comments in vim such as above.

The string will be formated and fulfilled with characters following your desired style.

############################################
#### CREATE FILE BAR AND SEND TO SERVER ####
############################################

RUN echo "foo" > bar
RUN scp -i bar example.com:/dev/null

Installation

Yes, you can do it by the old-fashioned way

Clonning this repository and linking it to your .../bin/ folder.

git clone git@github.com:ernandojs/vim-header-composer.git
sudo mv vim-header-composer /opt/
sudo ln -s /opt/vim-header-composer/vhc /usr/local/bin
echo 'map <F2> :!vhc' >> ~/.vimrc

Makefile

You can also perform installation with make install.

Basic usage steps

  1. Install this script globally or not;
  2. Open any file using VI/VIM;
  3. In normal VIM mode (press <ESC>);
  4. Goto VISUAL mode (select the line - or lines - with SHIT + V);
  5. Press <F2> then <ENTER>;

Using styles

Instead of using the characters and the standard format you can set the string to process using styles as seen below.

Prettybox

vhc <<< "vhc:prettybox;Woooow I'm using prettybox!" produces:

┌─────────────────────────────┐
│ Woooow I'm using prettybox! │
└─────────────────────────────┘

For further information about styles see more examples.

About

Make header boxes with comments "#" of any selected string in VIM with shortcut.


Languages

Language:Makefile 53.0%Language:Shell 47.0%