You can use vim -b filename
to edit a file in binary mode, which will show ^M characters for carriage return and a new line is indicative of LF being present, indicating Windows CRLF line endings. By LF I mean \n
and by CR I mean \r
. Note that when you use the -b option the file will always be edited in UNIX mode by default as indicated by [unix]
in the status line, meaning that if you add new lines they will end with LF, not CRLF. If you use normal vim without -b on a file with CRLF line endings, you should see [dos]
shown in the status line and inserted lines will have CRLF as end of line. The vim documentation for fileformats
setting explains the complexities.
Also, I don't have enough points to comment on the Notepad++ answer, but if you use Notepad++ on Windows, use the View / Show Symbol / Show End of Line menu to display CR and LF. In this case LF is shown whereas for vim the LF is indicated by a new line.