# Split Window Aesthetics

Split Windows are one of the killer features of Vim, that surprisingly few editors get right. The default aesthetics though… they could use some work. It’s not obvious which split is active, and the divider is either too visible, or not visible enough.

Quick! Which split is active?

To me, it’s not obvious at all.

Of course, this is Vim, and we can do better than just accept the defaults. Today we’re going to work on customizing the folowing aspects to your taste.

• Making the active split more visible
• Tweaking the split divider

Compare the following image with the one above. While the visuals may not be to your taste, it should be pretty clear which of the splits is currently active, and the division between the two horizontal splits is even more obvious. Having an obvious vertical divider is good for GUI users because it requires less thinking to target your mouse when you want to grab it and drag to resize.

## Making the active split more obvious.

There are a few basic approaches to this:

• change the background text color of the inactive windows
• change the foreground text color of the inactive windows

The basic assumption is that your chosen color scheme makes the active text look just the way you want it, and we don’t want to screw with that. The most performant solution is likey to be just disabling syntax highlighting on the inactive windows. Personally I’m a fan of changing the background color of the inactive ones. No matter what we’re going to be mildly abusing Vim’s features because this isn’t really something that’s offered by default.

### Changing the background color of the inactive window

(screenshot from the diminactive GitHub repo)

Straight out of the box the results will be hideous, because it uses the colorcolumn value for your background and the defaults for this are usually bright red.

You can see what yours is currently set to by running :hi ColorColumn for example:

highlight ColorColumn
ColorColumn    xxx term=reverse ctermbg=0 guibg=#081c23


My recommendation is to choose a color that is a dimmer or less saturated version of your color scheme’s background.

highlight ColorColumn ctermbg=<number> guibg=<hex or color name>
" for example
highlight ColorColumn ctermbg=0 guibg=#081C23
" or
highlight ColorColumn ctermbg=0 guibg=DarkGrey


NOTE: In your ~/.vimrc this line must be after the line that loads your colorscheme (search for colorscheme). If it comes before it, your colorscheme, may override it with its own value.

#### Terminal ColorColumn

Many terminal emulators are very limited in what colors they can display.

ctermbg specifies the background clor of the terminal and it always expects a number. You can find the list of numbers and what color they correspond to by running :help cterm-color

#### GUI ColorColumn

You’re essentially unrestricted when it comes to what color you want to choose for GUI Vim clients. There is, of course, a list of color names you can choose from but none of them are ever quite right. My recommendation is to just search the web for “color picker” and use any of them that strikes your fancy. Once you’ve chosen a color use the hex color representation here in Vim. Mine, for example, is currently #081C23

### Changing the foreground text color of the inactive windows

This is technically possible, but I haven’t yet figured out a reliable way to do it. The closest solution I’ve found is this code snippet on stack overflow but I can’t recommend it because it doesn’t actually remove all the highlighting and despite a pretty minimal .vimrc I could only get it to work sometimes. If you know how to do this reliably, please let me know.

## Changing the visibility of the split divider(s)

### Vertical Splits

Vertical splits have a one character wide divider. By default this column contains a single pipe character | but you can make it anything you want, including nothing.

First figure out what your current settings are:

:set fillchars?
fillchars=stl:^,stlnc:=,vert:|,fold:-,diff:-


Then change vert to be any single byte character. To make it blank you would use an escaped space.

set fillchars=stl:^,stlnc:=,vert:\ ,fold:-,diff:-


Their coloration is controlled by the VertSplit highlighting group. To modify it you choose your colors and add a line like the following. As with CursorColumn above this should come after you load your color scheme and the terminal colors are limited. The *bg colors below are background and the *fg colors are foreground. So this would be a black character on an Orange background.

highlight VertSplit guibg=Orange guifg=Black ctermbg=6 ctermfg=0


## Horizontal Splits

Horizontal splits don’t use a simple divider like vertical splits do. Instead they use the active, or inactive version of your status bar. Modifying that is its own topic. For now my advice is to just install the Airline plugin. It looks cool, and provides lots of useful info.