0

I set statusline= and fillchars=vert:\| and the result is for horizontal is here when I try :sp:
enter image description here

When I try :vsp the reuslt here: enter image description here

I really like to tweak horizontal with fillchars but vim seems don't allow users to do it. How can I disable completely that annoying bar?

marked as duplicate by Rich, Martin Tournoij Nov 18 '17 at 1:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • so what exactly would you like to change. the vertical bar or the horizontal bar? – Christian Brabandt Nov 15 '17 at 9:41
  • The horizontal bar please, if we can change horizontal bar like vertical bar in fillchars like fillchars=horizontal:\- would be great. – Tuyen Pham Nov 15 '17 at 9:42
  • Yes, possible, but I'd like to keep this open. – Tuyen Pham Nov 15 '17 at 16:08
2

Just set the highlight of both the foreground and the background of the status line(s) to be the same colour as the background of the rest of the window:

:highlight StatusLine ctermfg=bg ctermbg=bg guibg=bg guifg=bg   
:highlight StatusLineNC ctermfg=bg ctermbg=bg guibg=bg guifg=bg
  • Well, at least this can be considered as a workaround solution. I tweaked mine like this. But kind of, with many years and vim's philosophy we can't save some spaces for a decade. :) – Tuyen Pham Nov 15 '17 at 16:18
  • 1
    Along with this answer to make a statusline look like an editable line -- I am thinking if it'd be feasible to do an autocmd CursorMoved along the lines of :exe "setl stl=".fnameescape(getbufline(bufnr('%'),line("w$")+1)[0]) so we could get 1 more line shown... Seems a lot of tweaks are needed but theoretically we could've written a plugin for that :P – Sunny Pun Nov 15 '17 at 16:32
  • @SunnyPun That's a ridiculous idea. I love it! – Rich Nov 15 '17 at 16:34
  • @SunnyPun: How to make it work? I'm kind of noob here. – Tuyen Pham Nov 15 '17 at 17:50
  • Sorry for being late! Have a look here: github.com/sunnypp/vim-horizon and please kindly tell me how many edge cases I have missed :P – Sunny Pun Dec 11 '17 at 17:17
1

OP's Question

(See if I got it correctly)

OP wanna have a fillchars for horizontal split line, just like the | for a vertical split. Fillchars line up as a line to split the windows.

I am not sure how OP made the vertical | disappear -- did OP use :set fillchars=\␣ (I mean the space) instead?

My Attempt to Answer

From :h fillchars, we know that :set fillchars=stl:- would fill the empty space after the statusline with -.

And then, to get rid of the file name from the statusline, from :h statusline we know that the default is empty. (That's why OP's attempt to do :set statusline= didn't remove the statusline)

-- so we have to set it to a single - by :set statusline=-.

Then the whole statusline (for an active Window) is now ----... and what's left is to also do :set fillchars+=stlnc:-, so non-active Window also has a nice horizontal line for splits.

Tl;dl;

:se stl=- fcs=stl:-,stlnc:-,vert:\|

Or a nicely documented one (for putting into a publicly shared .vimrc, maybe:

:set statusline=-        " hide file name in statusline
:set fillchars=stl:-     " fill active window's statusline with -
:set fillchars+=stlnc:-  " also fill inactive windows
:set fillchars+=vert:\|  " add a bar for vertical splits

For whatever reasons, we can also hide the most bottom statusline:

:set laststatus=0

Tested on my own Vim version 7.4.8056 on macOS with vim -u /dev/null.

  • More article here. Basically we can't disable statusline yet. Even neovim has same issue. I'm surprised that people don't consider this as serious issue. Maybe use only :vsp or buffertab instead. – Tuyen Pham Nov 15 '17 at 15:46
  • Just read the links, for my ViM by :se ls=0 I don't have the bottom most statusline, and other "splitting lines" can be "emptied" using :se stl=\␣ fcs=stl:\ ,stlnc:\ ,vert:\ ... Is there any issues setting all of them to spaces? Or you wanna even auto-hide the command line? – Sunny Pun Nov 15 '17 at 15:52
  • Yes, we can hide statusline at bottom but if you split it use :sp, top window will preserve a statusline and we can't hide/disable it. – Tuyen Pham Nov 15 '17 at 15:55
  • 1
    Seems that the empty line isn't what you want. Do you want an empty line that is same as the background color? (@Rich's answer) Or you want a very thin line to split the 2 documents... Or really nothing between the 2 splits? – Sunny Pun Nov 15 '17 at 15:59
  • 1
    it is not possible to hide the line completly, otherwise one couldn't see where one window ends and the other starts. – Christian Brabandt Nov 16 '17 at 6:40

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