Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change border-width of splits in VIM

Tags:

vim

macvim

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.

like image 821
Mickel Avatar asked Jul 06 '13 19:07

Mickel


People also ask

How do I switch between split screens in Vim?

To switch to the right window, press “Ctrl + w”, then “l”. To go to the left window, it's “Ctrl + w”, then “h”. If you did a horizontal split, then going up and down is necessary. For going up, press “Ctrl + w”, then “k”.


2 Answers

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).

like image 198
1983 Avatar answered Sep 26 '22 11:09

1983


Vim has different options for font style, used in hi command.

for example: NONE, bold, underline, italic, reverse, undercurl..

for your needs, you could get your current highlighting of vertsplit by:

:hi VertSplit

From your screenshot, I guess you have gui(or term)=standout try to change it into NONE:

hi! VertSplit guifg=[yourFG] guibg=[YourBG] gui=NONE

or if you run vim in terminal:

hi! VertSplit ctermfg=[yourFG] ctermbg=[YourBG] term=NONE

this should give you a narrower split line.

check out :h hi too see details

like image 22
Kent Avatar answered Sep 23 '22 11:09

Kent