Line Separators
Prev | Chapter 4. Working With Files | Next

## Line Separators

Unix systems use newlines (`\n`) to mark line endings in text files. The MacOS uses carriage-returns (`\r`). Windows uses a carriage-return followed by a newline (`\r\n`). jEdit can read and write files in all three formats.

The line separator used by the in-memory representation of file contents is always the newline character. When a file is being loaded, the line separator used in the file on disk is stored in a per-buffer property, and all line-endings are converted to newline characters for the in-memory representation. When the buffer is consequently saved, the value of the property replaces newline characters when the buffer is saved to disk.

There are several ways to change a buffer's line separator:

- In the Utilities>Buffer Options dialog box. See the section called “The Buffer Options Dialog Box”.

- By clicking the line separator indicator in the status bar. See the section called “The Status Bar”.

- From the keyboard, if a keyboard shortcut has been assigned to the Toggle Line Separator command in the Shortcuts pane of the Utilities> Options dialog box. By default, this command does not have a keyboard shortcut.

By default, new files are saved with your operating system's native line separator. This can be changed in the Encodings pane of the Utilities>Options dialog box; see the section called “The Encodings Pane”. Note that changing this setting has no effect on existing files.

Prev | Up | Next
Saving Files | Home | Character Encodings