0

Is there a system-wide way to configure the default newline character? If so, is there a way to query what this character is?

  • Where do you want this to be done - in Terminal, a text file or inside some programming language (Java, C#, C++, etc.) ?? – Rene Larsen Jun 21 '17 at 20:01
  • @ReneLarsen: Setting: either Terminal or a text file. Getting: Terminal. – Evan Aad Jun 21 '17 at 23:43
  • Here are some options for displaying the line feed character(s): stackoverflow.com/questions/3569997/… – Rene Larsen Jun 22 '17 at 15:50
  • @ReneLarsen: I explicitly mentioned system-wide in the title as well as in the body of my question to emphasize that I am not interested in the settings pertaining to a particular file or application, which is what the post you linked to addresses. – Evan Aad Jun 22 '17 at 15:55
  • Well system-wide macOS is using CR, and can not be changed - you can however change the newline character(s) used in various editors to use Unix or Windows/DOS newline character(s). In the link there are some ways to see which character(s) a file has - and then if it is what one want - convert from dos 2 unix or from unix 2 dos (which then changes the newline character(s)) – Rene Larsen Jun 22 '17 at 16:45
2

No, there is not any way to configure the newline character system wide.

Modern macOS applications typically use \n (Unicode character U+000A) as the line separator.

Applications developed for Classic Mac OS (i.e, Mac OS 9 and earlier) often used \r (Unicode U+000D) as a line separator, but this usage is extremely rare nowadays.

A good text editor will let you choose your line break:

enter image description here

  • Thanks. Out of curiosity: what text editor did you take the screenshot from? – Evan Aad Jun 21 '17 at 23:45
  • 1
    This one seems to be from TextWrangler - there is a similar setting in TextMate – Rene Larsen Jun 22 '17 at 15:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .