DrawIt : Une extension VIM pour faire des diagrammes en ASCII

From Deimos.fr / Bloc Notes Informatique
Jump to: navigation, search
Drawit VIM

1 Introduction

DrawIt permet de faire des diagrammes en ASCII. Très pratique et évite de s'embêter avec des outils inutiles.

Si vous souhaitez convertir vos schéma ASCII en image, utilisez Ditaa.

2 Installation

Pour l'installer, ce n'est pas bien compliquer puisqu'il existe un petit installateur pour vim :

Command
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

Et le tour est joué.

3 Utilisation

Pour l'utiliser, là encore ce n'est pas bien compliqué, je vous fait un copier coller de la doc car c'est suffisamment clair.

Les commandes de base :

  • Activer le draw : \di
  • Désactiver : \ds
Touches Descriptions
<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
v draw 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
\v draw fat v arrow
\a draw arrow based on corners of visual-block
\b draw box using visual-block selected region
\e draw an ellipse inside visual-block
\f fill a figure with some character
\h create a canvas for \a \b \e \l
\l draw line based on corners of visual block
\s adds spaces to canvas
<leftmouse> select visual block
<s-leftmouse> drag and draw with current brush (register)
\ra ... \rz replace text with given brush/register
\pa ... like \ra ... \rz, except that blanks are considered to be transparent