Search code examples
vimmacvim

Change border-width of splits in VIM


I have been configuring my VIM installation for days now, and it's just a few more days away from heavenly perfect. Only thing that is bugging me however, is the border width of the splits.

Is there any way to change the width of these? Or maybe just set the color of them to the same as the background?

enter image description here

I mean the clunky 6/7px vertical border displayed in this picture.


Solution

  • The split will always be one character cell wide. However you can

    set fillchars+=vert:\|
    

    and set the VertSplit highlight group to something appropriate, e.g.

    hi vertsplit guifg=fg guibg=bg
    

    in your colour scheme. Since the splits are drawn using the '|' character, the line will be broken rather than continuous which is unfortunate. Unless you can find a font that contains a full height bar (but remember that extended characters can't be used in options in the command line, but they can in the command window or in your vimrc).

    If you do use a full height bar, you also need to make sure that 'linespace' is set to 0 (it defaults to 1 in gvim on Windows).