1

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

Thomas Vanhelden
  • 879
  • 8
  • 20

2 Answers2

7

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.

dNitro
  • 5,145
  • 2
  • 20
  • 45
  • I don't understand. I'm literally following a tutorial. The guy in the tutorial installs Vim through brew, exactly as I did. When he uses Vim to edit any file, the status line shows things like the mode he's in, file type, character encoding, etc. I want to use vim for Haskell. I've installed haskell-vim-proto and I'm using his vimrc to which contains configuration for advanced features. When I use that vimrc, there is no status line at all, even though it should show many things. When I add `set laststatus=2` to that file, the status line is just blank. – Thomas Vanhelden Oct 22 '16 at 10:50
  • I think they used fully featured setup script: [haskell-vim-now](https://github.com/begriffs/haskell-vim-now) and in this repository's .vimrc it icludes [Plug 'bling/vim-airline'](https://github.com/begriffs/haskell-vim-now/blob/d6fd8d84e2450add3bd44e8b3d873ba46b143634/.vimrc#L101), means they use [vim-airline](https://github.com/vim-airline/vim-airline) plugin. – dNitro Oct 22 '16 at 11:19
  • Yes, I know. But sadly, I can't get haskell-vim-now to install... The installation fails with this error: `curl: (22) The requested URL returned error: 404 Not Found Error: Failed to download resource "par--patch" Download failed: http://sysmic.org/dl/par/par_1.52-i18n.4.patch *** Installer requires 'par'. Please install and try again. *** Aborting...` – Thomas Vanhelden Oct 22 '16 at 12:03
  • 1. `cd ~/Desktop`, 2. `git clone https://github.com/begriffs/haskell-vim-now.git`, 3. `cd haskell-vim-now`, 4.`install.sh --repo ~/Desktop/haskell-vim-now` – dNitro Oct 22 '16 at 12:26
  • How would that solve the error I get? I just get the exact same error by doing that: `==> Downloading http://sysmic.org/dl/par/par_1.52-i18n.4.patch curl: (22) The requested URL returned error: 404 Not Found Error: Failed to download resource "par--patch" Download failed: http://sysmic.org/dl/par/par_1.52-i18n.4.patch *** Installer requires 'par'. Please install and try again. *** Aborting...` – Thomas Vanhelden Oct 22 '16 at 12:34
  • Installer requires 'par': Do `brew up` and `brew install par`, then try again. – dNitro Oct 22 '16 at 12:53
  • I get a similar error now: `--- Installing system packages [par] using [BREW]... --- Installing with homebrew... /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mach (LoadError) from` `*** Installer requires 'par'. Please install and try again. *** Aborting...` – Thomas Vanhelden Oct 22 '16 at 12:59
  • I am suspicious that you are not added `/usr/local/bin` to $PATH. so do: `export PATH=/usr/local/bin:$PATH` and try again. If same error, take @romainl suggestion and report issue to its maintainers. – dNitro Oct 22 '16 at 13:24
6

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.

romainl
  • 186,200
  • 21
  • 280
  • 313
  • That could be the problem. But what should I do then, to get haskell-vim-proto working? Because I'm installing as instructed and my status bar is still blank, even with the vimrc from haskell-vim-proto. – Thomas Vanhelden Oct 22 '16 at 13:05
  • First, you *shouldn't* use a "distribution" like that haskell-vim-proto thing. Two, if you absolutely insist on using that crap, [use its issue tracker](https://github.com/sdiehl/haskell-vim-proto/issues). – romainl Oct 22 '16 at 13:15