vimtricks.wiki Concise Vim tricks, one at a time.

How do I customize the vertical split separator and fold indicator characters in Vim?

Answer

:set fillchars+=vert:│,fold:·

Explanation

The fillchars option controls the filler characters Vim uses for various UI elements — window separators, fold fill lines, diff padding, and more. By default the vertical split uses | and folds fill with -. Swapping these for Unicode box-drawing characters produces a much cleaner, terminal-native look without any plugins.

How it works

  • :set fillchars — set the fill characters option
  • += — append to the existing value instead of replacing it
  • vert:│ — use U+2502 BOX DRAWINGS LIGHT VERTICAL as the split separator
  • fold:· — use U+00B7 MIDDLE DOT as the fold-fill character

The full list of fillchars keys includes: vert, fold, foldopen, foldclose, foldsep, diff, eob, lastline, and (Neovim) msgsep.

Example

For a polished look with no highlight on the separator:

:set fillchars=vert:│,fold:·,eob: 
:highlight VertSplit ctermfg=240 guifg=#555555 ctermbg=NONE guibg=NONE

This replaces the | bar with a seamless line character and removes the end-of-buffer ~ markers.

Tips

  • In Neovim you can also set foldopen:▾ and foldclose:▸ for triangle fold indicators
  • Use :set fillchars? to inspect the current value
  • Add to init.vim / init.lua (as vim.opt.fillchars:append(...)) for persistence
  • The VertSplit highlight group controls the color of the separator; :hi VertSplit guifg=... to match your theme

Next

How do I incrementally expand or shrink a selection based on syntax tree nodes using nvim-treesitter?