Problems opening and saving files from a linux server - keeping LF EOL
-
I use WinSCP to manage files on various linux servers, and I have Notepad++ set up as the default editor.
Every file it opens it defaults to a Windows EOL format, ignoring what is actually in the file. I can change the format, but it is a pain to do it every time.
Is there a way to get Notepad++ to honor the EOL format of the files it opens?
Thanks.
My Notepad++ info is:
Notepad++ v8.7 (64-bit)
Build time : Sep 17 2024 - 17:06:31
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : OFF
OS Name : Windows 11 Pro (64-bit)
OS Version : 24H2
OS Build : 26100.2161
Current ANSI codepage : 1252
Plugins :
ComparePlus (1.2)
JSMinNPP (1.2312)
mimeTools (3.1)
NppConverter (4.6)
NppExport (0.4) -
When Notepad++ opens a file, it decides on the file’s EOL format based on the first line ending it sees: if the first line ending is CRLF, then it will choose Windows EOL format; if the first line ending it sees is LF, it will choose Unix (LF) as the EOL mode.
Thus, if Notepad++ is opening the file in Windows EOL format, I am quite confident that the first EOL was CRLF, not just a linux LF.
That said, I believe that WinSCP, like other FTP clients, can be configured to automatically convert line endings… so my guess is that it’s converted the line ending when it did the transfer, and that your problem has nothing to do with Notepad++ behavior. (If you don’t want WinSCP to do the conversion, look for settings to put it into “binary” mode instead of “ASCII” mode, or some such. Or set it up so it does the conversion in both directions, so that Notepad++ can edit it Windows EOL but WinSCP changes it back to Linux EOL when it sends it back to the server.)