How to make a continuous vertical line in vim?
If your version of Vim is compiled with multibyte
support and your terminal encoding is set correctly, you may use the Unicode box-drawing characters, which include horizontal and vertical lines as well as several varieties of intersections and blocks. Vim defines some default digraphs for these characters, such as vv
for │
(to enter a digraph, you use Ctrl-K; thus in insert mode ^Kvv
will insert the character │
at the cursor location). For the full list if your version of Vim supports it, type :digraphs
; for more information on the feature and to search by Unicode character name, type :help digraphs
.
Depending on your terminal settings and choice of font, however, box-drawing characters may not all render as connected lines, so your mileage may vary. For instance, on my machine vertical lines render as connected in the terminal (using Source Code Pro), but as broken lines in GVim (using DejaVu Sans Mono):
For completeness, regarding the previous answer:
^kvv
leads to │^kdr
leads to ┌^khh
leads to ─^kdl
leads to ┐^kur
leads to └^kul
leads to ┘
Notice you can use upper case for a thicker line:
^kVV
is ┃^kDR
is ┏^kHH
is ━^kLD
is ┓ (LD, and not DL, for some reason)^kUR
is ┗^kUL
is ┛
There are also versions with one upper and one lower case.