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 mode
to edit into the diagram- this mode can be invoked by
gR
- this mode can be invoked by
-
Difference between
visual replace
andreplace
mode?
replace
mode replaces character for each character you type
V-replace
replaces screen real estate, so that characters further on in the file never appear to move. -
Why not to use
replace
mode?
The difference arises for<TAB>
character. Inreplace
mode, one<TAB>
replaces one whichever character it is. But inV-replace
mode, it makes it appear that further characters in file are not shifting.
For example, draw a box diagram<leader>boxd
while ininsert
mode.
+----------------+
| |
+----------------+
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