In the context of text files, line endings or encoding refer to the characters that are used to indicate the end of a line of text.
There are three main types of line endings used in modern operating systems.
- Carriage return (CR) - used by older Macintosh Operating Systems
- Line feed (LF) - used by Unix/Linux Operating Systems
- Carriage return + line feed (CRLF) - used by Windows Operating Systems
To change the line endings (encoding) in Sublime Text, you can use the "Line Endings" option in the "View" menu. Here are the steps:
- Open the text file in Sublime Text App.
- Go to the Menu: View.
- Move your cursor to "Line Endings" and you will see the available options: Windows, Unix, and Mac OS 9.
- Select the desired line ending format.
Once you select a line ending format, Sublime Text will automatically convert the line endings in the text file to the selected format.
Set Default Line Ending for all files
You can also configure Sublime Text to use a specific default line-ending format for all new files you create. To do this, go to the "Preferences" menu and select "Settings" (Sublime Text -> Settings -> Settings on macOS). In the right-hand pane, add the following line to the user preferences file.
Example:"default_line_ending": "unix"

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!

Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!