IfChan
IfChan

Reputation: 49

Vim don't show last empty line

I have written some c code, and the end of my output is '\n', when I check the output text file in vim, I cannot find the last empty line, however, when I open it with another text viewer, I can find the last empty line. How can I configure my vim to show the empty line?

Upvotes: 3

Views: 1838

Answers (1)

Ingo Karkat
Ingo Karkat

Reputation: 172698

The way Vim shows \n / 0x0a at the end of the file is that it opens the file without complaining about [noeol] when :editing the file (in a kind of "reverse logic" from what you expect). Vim's (and Unix) philosophy is that the trailing newline should be there. This can be confusing when one is used to other editors or predominantly works on MS Windows.

There's a lot of discussion and questions about this (e.g. here); as this is unlikely to change, get used to it.

Upvotes: 4

Related Questions