This plugin is made to be used to design box diagrams in Vim easily.
Following are few examples:
+----------------+ ┌────────────────┐
| | │ │
+----------------+ └────────────────┘
+----------------+----------------+----------------+
| | | |
+----------------+----------------+----------------+
| | | |
+----------------+----------------+----------------+
+----------------+
| |
+----------------+
| |
+----------------+
| |
+----------------+
- For manual installation execute the following commands in your terminal:
$ mkdir -p ~/.vim/bundle/vim-draw
$ git clone https://github.com/weirdsmiley/Vim-Draw.git ~/.vim/bundle/vim-draw/
$ vim -u NONE -c "helptags ~/.vim/bundle/vim-draw/doc" -c q-
For keybindings and function usage see
doc/vim-draw.txt -
Use
visual replace modeto edit into the diagram- this mode can be invoked by
gR
- this mode can be invoked by
-
Difference between
visual replaceandreplacemode?
replacemode replaces character for each character you type
V-replacereplaces screen real estate, so that characters further on in the file never appear to move. -
Why not to use
replacemode?
The difference arises for<TAB>character. Inreplacemode, one<TAB>replaces one whichever character it is. But inV-replacemode, it makes it appear that further characters in file are not shifting.
For example, draw a box diagram<leader>boxdwhile ininsertmode.
+----------------+
| |
+----------------+
Type <TAB> while in replace mode. This will replace the whitespace with tab character which will make it shift.
+----------------+
| |
+----------------+
On the other hand, typing <TAB> while in V-replace mode will not make the right portion shift.
+----------------+
| |
+----------------+
The box has a tab character inside it.
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
Vim-Draw | version 1.1.0