37

At the right of my vim-airline display, I have ! trailing[1].

I'm assuming this means trailing whitespace of some sort, but how do I read what vim-airline is telling me and what am I supposed to do?

prajmus
  • 3,171
  • 3
  • 31
  • 41
Eric Francis
  • 23,039
  • 31
  • 88
  • 122
  • 4
    It means you have trailing whitespace on line 1, and you could, um, delete it? Or ignore it, or turn off the check :) – hobbs Sep 15 '15 at 14:29
  • Check these posts on removing trailing whitespace: http://stackoverflow.com/questions/356126/how-can-you-automatically-remove-trailing-whitespace-in-vim#356130 – Johannes Ranke Nov 17 '16 at 17:05

3 Answers3

43

That means you have a trailing whitespace on the first line ([1]).

You can add to your .vimrc the following:

set list          " Display unprintable characters f12 - switches
set listchars=tab:•\ ,trail:•,extends:»,precedes:« " Unprintable chars mapping

That'll display whitespace chars. You can toggle it with :set invlist.

qiubix
  • 1,302
  • 13
  • 22
17

Airline is telling you that on line 1 you have trailing whitespace, which is usually something you want to get rid of.

So go to the line and delete it (1G$gelD).

It’s a good feature, but you can turn it on/off with:

:AirlineToggleWhitespace

More info on trailing whitespace here.

Micah Elliott
  • 9,600
  • 5
  • 51
  • 54
8

To turn off the trailing whitespace check at startup, add to your vimrc:

let g:airline#extensions#whitespace#enabled = 0

FixFlixx
  • 81
  • 1
  • 1