Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the characters used for empty space in Vim status line?

Tags:

vim

I’m using the following statusline setting in Vim:

set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P

It produces the following status line:

Status line screenshot

like image 312
sent-hil Avatar asked Aug 28 '11 19:08

sent-hil


3 Answers

Had the same issue, and eventually realized that I was seeing it only when using certain colorschemes. A little more digging revealed that these colorschemes were setting StatusLine and StatusLineNC highlighting groups to identical values.

:help StatusLineNC notes that if StatusLine and StatusLineNC have equal values, then Vim will use ^^^ in the status line of the current window.

The fix was to comment out the lines that changed these values in the problematic colorschemes.

like image 86
thecloud Avatar answered Oct 23 '22 18:10

thecloud


The fillchars option specifies the characters to fill status lines and vertical separators. The stl: and stlnc: items in the option’s value correspond to the status line of the current window and the status lines of the other windows, respectively. See the current state of the fillchars option (by :set fcs?), and try to set the filling characters for statusline explicitly:

:set fillchars+=stl:\ ,stlnc:\ "

(Here the last quote symbol starts a comment and does not affect the value set, it was added only to make preceding space noticeable.)

like image 41
ib. Avatar answered Oct 23 '22 19:10

ib.


standard statusline is :set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P so I guess it's the fugitive-part that is causing this. What does it do? and in what format does it display data?

from :help 'statusline':

{ NF  Evaluate expression between '%{' and '}' and substitute result.
          Note that there is no '%' before the closing '}'.

You're statusline looks correct so have a look at the fugitive part...


UPDATE

Did a git clone http://github.com/tpope/vim-fugitive and tried the statusline above which can be found in the documentation for fugitive and the statusline is correctly displayed for me. Using xbuntu 11.04. So update to the latest and try again is my advice. and use set ruler

like image 29
Fredrik Pihl Avatar answered Oct 23 '22 18:10

Fredrik Pihl