If I create a file without an EOL, for example:

$ echo -n "1" > test

...and then open it in vim:

$ vim --clean test

...the left hand side of the statusline looks like:

"test" [noeol] 1L, 1C

Yet when I open the file with my own statusline there is no [noeol] flag. I cannot see any information in the docs for statusline about how to get this flag.

How should I configure my statusline to see this flag?

Many thanks!

  • 1
    That's not a statusline. That's a message from Vim, like you get "foo", 1L, 2C written when you save the file.
    – muru
    Commented Dec 11, 2018 at 10:15
  • 1
    Check the eol option setting. Commented Dec 11, 2018 at 12:11
  • And if you found the solution for what you wanted to do or the resource you needed, don't hesitate to answer your own question so that it is useful for future reader
    – statox
    Commented Dec 11, 2018 at 13:45

2 Answers 2


I had thought that [noeol] was one of Vim's built in statusline flags, like [+] for modified. But @muru pointed out that it isn't; it's a message from Vim when you write a buffer (without an eol). This answers the question I thought I asked.

However if one does want to add [noeol] to the statusline then, as @ChristianBrabandt said, one can simply check the eol option and display [noeol] as appropriate. This answers the question I seem to have asked.


You could check the value of endofline and display your statusline accordingly. For example, this shows [noeol] in your statusline when endofline is false:

set statusline+=%{&endofline?'':'[noeol]'}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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