Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

changing vim's vertsplit character to │

Tags:

vim

This is, I assume, codepage related, but doesn't hurt asking.

How would one, on windows xp's cmd, gvim 7.2 change vertsplit character, so that instead of default | it is │ (so that it makes a full, and not an splitted line) ?

That character is usually changed with

set fillchars=vert:\|

and I can copy paste the ascii graphics line there, but it comes out as garbage. I suppose I would have to change vim's internal codepage for it to show correctly ?

Anyone knows how to do this ?

like image 345
Rook Avatar asked Feb 15 '10 22:02

Rook


4 Answers

Ok, I'm really late to the party but this is what I do.

The way the characters are rendered depends on the font so you can get a continuous line using some fonts and not with others. I've found that using one of the following gives me an unbroken line.

  • Menlo
  • Monaco
  • Inconsolata
  • DejaVu Sans Mono
  • Consolas
  • Bitstream Vera Sans Mono

As far as settings go, the following is sufficient. Note that this is different from the | character commonly present on keyboards.

set fillchars=vert:\│
like image 137
kshenoy Avatar answered Sep 30 '22 03:09

kshenoy


I've tried the following :

set enc=utf-8
set fillchars=vert:\│

And it worked, but the result weren't has good as you can hope, it's still not a full line (using the Consolas font, if you get a straight line with another font, I'd be interested to know which one).

like image 36
Raoul Supercopter Avatar answered Sep 30 '22 03:09

Raoul Supercopter


This isn't exactly what you want, but I've set fillchars=\ and just use highlighting to color the blank space a different color. It's less elegant, but it looks fine to me.

like image 20
Randy Morris Avatar answered Sep 30 '22 03:09

Randy Morris


Digging through the digraph table, I found that the "Box drawings light vertical" is perfect for this purpose. Vim's digraph table entry: │ vv 2502 9474 BOX DRAWINGS LIGHT VERTICAL To use it, press <c-k>vv in insert or command mode to get the character (see :h i_CTRL-K).
As pointed out by others, the setting is applied with set fillchars=vert:|

like image 42
Ketan Kanishka Avatar answered Sep 30 '22 05:09

Ketan Kanishka