sponsor Vim development Vim logo Vim Book Ad

draw.vim : Draw rectangles and lines using blockwise Visual selection.

 script karma  Rating 35/17, Downloaded by 1958  Comments, bugs, improvements  Vim wiki

created by
Timo Frenay
script type
This plugin allows you to draw rectangles and lines using blockwise Visual mode, which makes it ideal for drawing tables and such. Simply move the cursor to the start position, hit CTRL-V to enter blockwise Visual mode and move the cursor to define the rectangle or line. Finally, type <leader>d to draw the rectangle or line. If you don't know what <leader> is, \d should do the trick. This script supports UTF-8 as well as PC-8 boxdrawing characters, and checks the value of 'encoding' to determine which it should use. If you use a single byte character set other than ECS/PC-8 which includes boxdrawing characters, please notify me so I can add support for it.

Note: I strongly recommend ":set virtualedit+=block" when using this script, so you can define rectangles beyond the end of the line.
install details
Just put it in your plugin directory, or :source it when you want to use it.

Tested under Windows 2000 with UTF-8 and PC-8 in GVim, and PC-8 in console mode Vim, both version 6.1 without patches.

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
draw.vim 1.0 2002-10-19 6.0 Timo Frenay Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
Vim at Github