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:
Have Questions? Post them here!
- Sublime Text 3 Convert Case to Upper, Lower, Title or Swap
- Change Sublime Text 3 white background color theme
- Replace new line with comma in Sublime Text Editor
- Word count in Sublime Text Editor
- How to add ruler in Sublime Text tab window
- How to Set Permanent ruler in Sublime Text
- How to install Packages in Sublime Text Editor
- Change Line Endings (Encoding Windows/Mac/Unix CR/LF/CRLF) Sublime Text
- Steps to Compare Two files in Sublime Text Side-by-Side
- How to find Sublime Text path of packages installed
- How to display File CR LF Newline Characters in Sublime Text
- How to add Multiple Rulers in Sublime Text
- How to shuffle lines randomly in Sublime Text
- Java 8: Get First and Last Date of the Week for Given Date - Java
- Create a file using Mac Terminal - MacOS
- Fix [oh-my-zsh] Cant update: not a git repository - Git
- Tkinter - add x and y padding to label text - Python
- Mac OS X Stuck During Booting Gray Screen Logo and Spinner - Mac-OS-X
- Share Image to WhatsApp with Caption from your Android App - WhatsApp
- Notepad++ delete lines above or below - NotepadPlusPlus
- [Android Studio] MainActivity does not exist - Android-Studio