Drawit VIM

Introduction

DrawIt allows you to create ASCII diagrams. It’s very practical and avoids the hassle of using unnecessary tools.

If you want to convert your ASCII diagrams to images, use Ditaa.

Installation

Installation is quite simple as there is a small installer for vim:

  cd ~
wget -O DrawIt.vba.tgz "http://www.vim.org/scripts/download_script.php?src_id=8798"
gzip -d DrawIt.vba.tgz
mv DrawIt.vba.tar Drawit.vba
vim Drawit.vba
:so %
:q
  

And that’s it.

Utilization

Using it is also quite straightforward. I’m just copying and pasting the documentation as it’s clear enough.

Basic commands:

  • Activate draw: \di
  • Deactivate: \ds
KeyDescription
<left>move and draw left
<right>move and draw right, inserting lines/space as needed
<up>move and draw up, inserting lines/space as needed
<down>move and draw down, inserting lines/space as needed
<s-left>move left
<s-right>move right, inserting lines/space as needed
<s-up>move up, inserting lines/space as needed
<s-down>move down, inserting lines/space as needed
<space>toggle into and out of erase mode
>draw -> arrow
<draw <- arrow
^draw ^ arrow
vdraw v arrow
<pgdn>replace with a \, move down and right, and insert a \
<end>replace with a /, move down and left, and insert a /
<pgup>replace with a /, move up and right, and insert a /
<home>replace with a \, move up and left, and insert a \
\>draw fat -> arrow
\<draw fat <- arrow
\^draw fat ^ arrow
\vdraw fat v arrow
\adraw arrow based on corners of visual-block
\bdraw box using visual-block selected region
\edraw an ellipse inside visual-block
\ffill a figure with some character
\hcreate a canvas for \a \b \e \l
\ldraw line based on corners of visual block
\sadds spaces to canvas
<leftmouse>select visual block
<s-leftmouse>drag and draw with current brush (register)
\ra … \rzreplace text with given brush/register
\pa …like \ra … \rz, except that blanks are considered to be transparent

Last updated 05 Jun 2010, 20:40 CEST. history