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!
After everything you want to change is highlighted, type
r_.