Vim status line not working

6.9k Views Asked by At

I'm on OS X and I've installed Vim using Homebrew via

brew install vim

I noticed that whenever I use Vim, there is no status line appearing at the bottom. I thought I could fix it by always displaying the status line by adding the following to vimrc:

:set laststatus=2

This shows me the status line but it's just an empty line above the ruler. It looks like this: enter image description here

Am I missing something?

EDIT

I want to use Vim for Haskell. I've installed haskell-vim-proto. I'm using the included included vimrc which should result in showing things like syntax errors in the status line. When I edit Haskell files (with the vimrc), there is no status bar in my Vim. Adding set laststatus=2 to the vimrc results in a blank status line showing.

When I'm following tutorials that install Vim through HomeBrew (as I did), opening any time of file with Vim shows the status line at the bottom containing things like this:

I'm literally following this tutorial. When he opens .bash_profile with Vim, it looks like this: enter image description here When I do the exact same thing, it looks like this: enter image description here

2

There are 2 best solutions below

2
romainl On BEST ANSWER

The guy who made that tutorial made a very big and very common mistake: he is using a heavily customized Vim instead of vanilla Vim. This rather obviously gives new users wrong expectations.

Basically, everything you see in that first screenshot:

  • colorful pseudo-tabline
  • colorful statusline
  • colorscheme
  • relative line numbers

is either provided by one or more plugins that the author failed to mention or by a built-in option that he also failed to mention.

If you absolutely need an "always-on" statusline, follow @dNitro's suggestion.

If you absolutely want the exact same setup as the author (which is not a very good idea in and of itself), I'd suggest you contact him directly. People should take full responsibility of the crap they put online.

8
dNitro On

Status line by default is just like that gray line and will always remains there as long as you set laststatus=2.

What you are missing is formatting this line to show the items you want it to show you. you can do it manually yourself. just add the following to .vimrc and see what happens:

set statusline=%F%m%r%h%w%=\ [%Y]\ [%{&ff}]\ [%04l,%04v]\ [%p%%]\ [%L]

to decipher see: :help statusline and add your desired items.

Or use a plugin: vim-airline and lightline.vim are two popular one.