How do I draw a vertical line instead of typing one by one?
For example, I wanna set a vertical line in column 10 for 20 rows. Just like my first line. how do I do that in smart way?

First, set virtualedit=all, to allow yourself to navigate past the end of a line:
:set virtualedit=all
Then...
10|<C-V>20jr|
Where:
10|: moves you to screen column 1020j: moves you down 20 lines (adjust to taste)r|: replaces the selection with barsThe following is an alternative solution to setting virtualedit=all in order to make 20 rows with a | in column 10:
10i<space><esc>r|
10ispace will insert space ten times, and pressing esc followed by r| will replace the last character with a |
Y
20p
In sum:
10i<space><esc>r|Y20p
This appears to be a VIM plugin to do exactly what you are looking for:
http://www.vim.org/scripts/script.php?script_id=40
I have not tried it myself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With