Linux EOT on existing files
-
I’m using Windows, and whenever I modify a file, NPP adds automatically Windows line returns to all the lines of the file.
In Settings, I can find an option to use Unix LF on new files, but not on existing ones.
I’m surprised and disapointed the way this thread was closed. If no solution is available, then enough time loss, I switch to another editor. -
I’m using Windows, and whenever I modify a file, NPP adds automatically Windows line returns to all the lines of the file.
I’m using npp to edit linux files on a daily basis and I don’t have that issue, so I’m in doubt npp does this.
In Settings, I can find an option to use Unix LF on new files, but not on existing ones.
Npp adds the eol it finds.
To be more precise, my understanding is that npp checks the first line for its eol and uses this on every new line addedI’m surprised and disapointed the way this thread was closed.
If no solution is available, then enough time loss, I switch to another editor.Do whatever you think is best for you.
-
@Ekopalypse Glad you are using Linux, I do on my personal computer but at work you don’t have so much choice … Depending on where you work .
I reformulate the problem and trying to be as simple as possible:
I have files that already contain Unix EOLs. Whenever I modify an existing file, even if I add only a line, NPP will modify the existing Unix EOLs to Windows EOL for all the existing lines ( lines I did not modify ) .My need : I’m wondering if there is a setting I can use to prevent that behavior.
-
@Ekopalypse said in Linux EOT on existing files:
npp checks the first line for its eol
Moreover, NPP will tell you what EOL mode it is using, near the lower-right of the window, in the status bar:
If you use View > Show Symbol > Show End of Line (or Show All Characters), you can see what line endings really exist in the file. You can see there whether maybe you accidentally have a mixed-EOL file, like @Ekopalypse implied.
If you use Edit > EOL Conversion, whichever option (Windows CRLF, Linux LF, or Macintosh CR) is greyed out is the option currently in use. If it selected Windows CRLF and you want Unix LF, you can select Linux LF. If going two menus deep to change that is too tedius for you, you can right-click on the
Windows (CR LF)
in the status bar change it to one of the other line endings. Or you could use Settings > Shortcut Mapper one time to filter onUnix
, double-click onUnix (LF)
, and add a shortcut (maybeAlt+Shift+L
for “Linux LineFeed”), so that if it ever imports your file as the wrong type, you can quickly change it to Unix LF.And, like in the previous thread mentioned, this assumes that the files actually have LF EOL. In the previous thread, the problem was that their FTP program converted Linux LF to Windows CRLF. That’s not Notepad++'s fault.
-
@Meh-Di said in Linux EOT on existing files:
@Ekopalypse Glad you are using Linux, I do on my personal computer but at work you don’t have so much choice … Depending on where you work .
I reformulate the problem and trying to be as simple as possible:
I have files that already contain Unix EOLs. Whenever I modify an existing file, even if I add only a line, NPP will modify the existing Unix EOLs to Windows EOL for all the existing lines ( lines I did not modify ) .
My need : I’m wondering if there is a setting I can use to prevent that behavior.Your reformulation did nothing to prove your point. Notepad++ is not changing the EOL unless you tell it to – at least, it never has for me or @Ekopalypse, in years of editing linux-line-ending files using Notepad++.
If you think it’s changing the line endings, prove it. Show a screenshot with View > Show Symbol set to EOL or All Characters, with the Linux-line-ending file showing LF but the lower-right showing Windows CRLF, and then edit one line, and show the screenshot will all of those LF converted to CRLF. It’s simple to prove me wrong.
-
just to give you an idea how am I working with it.
We upload parameter files to embedded devices running real time linux.
The files are stored on a NAS running debian linux.
Using npp on a windows PC with a mapped drive to the NAS.
Edit, save and upload to the embedded devices from within npp.
Never had any issue that those files got corrupted.