65

How do I style or remove the grey bar that appears on window split?

enter image description here

4 Answers 4

78

You'll need to edit your colorscheme. The highlight group is VertSplit.

If you want to get rid of the pipe characters you can set ctermbg and ctermfg to the same value.

Additional information on styling vertical split borders*:

*Taken from ib. answer below.

In order to get rid of | characters, one should rather change vertical separator using:

:set fillchars+=vert:\ 

(note the significant whitespace after the '\' character)

9
  • 27
    Actually, in order to get rid of | characters, one should rather change vertical separator using :set fillchars+=vert:\ , than make background and foreground colors be equal (which is fine as workaround, but not as straightforward solution).
    – ib.
    Jan 25, 2012 at 12:57
  • 2
    @romainl: Suggestion on changing the vertical separator character does not answer the question about styling of vertical window borders completely. Either your answer (mentioning VertSplit) with my comment (about fillchars) does it, or, the other way around, my answer with your comment. So, there is no reason to increase entropy. Also, it is already accepted anyway.
    – ib.
    Jan 26, 2012 at 4:18
  • 1
    @Zen, it's statusline.
    – romainl
    Sep 24, 2014 at 5:09
  • 7
    Is it possible to remove (not make it look transparent) the separator? It is another precious character that I want to save up for my code.
    – baltazar
    Dec 24, 2014 at 17:13
  • 6
    btw, I like set fillchars+=vert:\▏ as vertical bar
    – marceloow
    Apr 19, 2020 at 10:38
17
highlight VertSplit cterm=NONE
9

I kind of tweak it a little to make it look like there is no splitbar with something like this

hi LineNr guibg=bg
set foldcolumn=2
hi foldcolumn guibg=bg
hi VertSplit guibg=bg guifg=bg

Note that I'm using gvim so I'm using guibg to change the background guifg to change the foreground with the same color of my vim's background, if you're not using a gui and you're on terminal vim you should change the guibg and guifg parameters for ctermbg and ctermfg

2
  • I get a BG not defined on some themes, what can I do? Nov 4, 2017 at 1:12
  • Try to use your gui settings on a different file named ~/.gvimrc Nov 16, 2017 at 20:04
0

If you add a comment with " after the whitespace, you don't have a trailing white space. I don't like these, so my vim config shows them (vim-airline plugin) and I remove them regularly.

:set fillchars+=vert:\ "White space at the end

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.