tags:

views:

66

answers:

2

I try to draw a class diagram using Vim.

  • I fill the editor window with white-spaces.

  • Type :match SpellBad /\s/ to highlight all the white-spaces.

  • Ctrl+Q to select vertical white-spaces.

  • Shift+I to insert Bar(|) and then Esc

  • ...........................

  • v+l +... + l to select horizontal white-spaces

But I don't know how to change all selected horizontal white-spaces to underscore(_).

I have to hit _ serval times.
When comes to long horizontal line, it's bad.

  ___________             ___________               
 |           |           |           |              
 | BaseClass |/__________|  Client   |              
 |___________|\          |___________|              
      /_\                                           
       |                                            
       |____________________________________        
       |                 |                  |       
  _____|_____       _____|_____        _____|_____  
 |           |     |           |      |           | 
 | SubClass1 |     | SubClass2 |      | SubClass3 | 
 |___________|     |___________|      |■■■■■■■■■■■| 

I want a quick method to do this.
Select it -> Change it -> Done!
Maybe map F6 to do it.
Thanks!

+9  A: 

After everything you want to change is highlighted, type r_.

Amardeep
A: 

There are plenty of tools for making ascii diagrams, and converting them to graphical UML. Why don't you try one of those?

e.g.

http://www.jave.de/

http://ditaa.sourceforge.net/

http://www.diku.dk/hjemmesider/studerende/firefly/stud.html

scomar