2

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 Dec 11 '18 at 10:15
  • 1
    Check the eol option setting. – Christian Brabandt Dec 11 '18 at 12:11
  • Thank you @ChristianBrabandt. – Andy Stewart Dec 11 '18 at 13:36
  • 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 Dec 11 '18 at 13:45
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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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