199

I notice that when I load a text file, Notepad++ will recognize and use whatever the newline character in that file is, \n or \r\n.

Is there some option where I can select which to use by default for new documents?
(I've looked in help and googled, but can't find anything.)

Henke
  • 4,445
  • 3
  • 31
  • 44
Luigi Plinge
  • 50,650
  • 20
  • 113
  • 180

4 Answers4

340

For any new document: Settings -> Preferences -> New Document (left pane) -> New Document (right pane) -> Format (Line ending) -> Windows (CR LF) / Unix (LF) / Macintosh (CR)

And for an already-open document: Edit -> EOL Conversion

Henke
  • 4,445
  • 3
  • 31
  • 44
Vlad
  • 18,195
  • 4
  • 41
  • 71
  • 3
    But note: in the the current version this only works when you create a new file with NP++. If you create an empty file it still seems to default to \r\n (when it finds no EOL characters to go by), and use that instead. – Jonathon Apr 17 '13 at 03:20
  • 3
    In version 7.7.1 this seems to default to the proper new document preferences. – Enthus3d Sep 19 '19 at 15:22
85

"Edit -> EOL Conversion". You can convert to Windows/Linux/Mac EOL there. The current format is displayed in the status bar.

Yada
  • 30,349
  • 24
  • 103
  • 144
4

on windows 10, Notepad 7.8.5, i found this solution to convert from CRLF to LF.
Edit > Format end of line
and choose either Windows(CR+LF) or Unix(LF)

velocity
  • 1,630
  • 21
  • 24
2

Just double-click on that EOL format in the status bar and select Unix(LF).
It's not possible to default save a file in this (LF) format.

How to change the EOL format in Notepad++.

Just an alternative to the "new document" setting mentioned earlier …

Henke
  • 4,445
  • 3
  • 31
  • 44
  • My guess is that the reason this answer has attracted downvotes is that this feature is no longer available in the versions of the last few years. I tried it in version 8.4.6 (32-bits), and it doesn't work. – Henke Oct 13 '22 at 12:03
  • @Henke Seems to work for me, and I'm running the latest version. – Eike P. Feb 16 '23 at 14:19
  • 32-bit or 64-bit? Maybe not relevant? When I have the time, I will update to the latest version to see if that makes any difference. – Henke Feb 16 '23 at 15:19