Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the line ending used in Netbeans

Tags:

Netbeans has this wiki entry on line endings: http://wiki.netbeans.org/FaqEditorEOLs

But it isn't very useful. It just says that you shouldn't develop on different OS and that's that...

In my situation however, I have no power over it. I'm on a windows machine and the PHP app I'm working on needs to end with the UNIX EOL.

There does not seem to be an option to set this for new files. Can anyone tell me where to set this?

like image 499
KdgDev Avatar asked Jul 20 '10 21:07

KdgDev


People also ask

What is Unix LF in NetBeans?

Quoted from the Netbeans Wiki: NetBeans editor respects the line separator used in an existing file. It reads the file into an editor document instance in the following way: First line of the file is read and the line separator type is determined - it is expected to be one of. "\n" (LF)- Unix.

What is default line ending?

If a new file is created the line ending will start with the system default: CRLF for Windows, LF for Mac and Linux, and CR for old-style Mac files. If a file contains multiple line-ending types it will display Mixed .

What is line endings in Windows?

Back to line endings The reasons don't matter: Windows chose the CR/LF model, while Linux uses the \n model. So, when you create a file on one system and use it on the other, hilarity ensues.

What is line ending in Linux?

Text files created on DOS/Windows machines have different line endings than files created on Unix/Linux. DOS uses carriage return and line feed ("\r\n") as a line ending, which Unix uses just line feed ("\n").


1 Answers

Just saw that you can set this as a command-line startup flag: -J-Dline.separator=LF

I haven't tested this myself but I'm looking for ways to bake this into the configs somehow.

like image 125
fentie Avatar answered Sep 21 '22 03:09

fentie