Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Atom editor - convert line endings to UNIX

Tags:

atom-editor

I need to convert the line endings of some mock data into Unix format. I'm using Atom editor on Win 7.

Looking online, I found an Atom package to convert line endings, but the package said it is deprecated since Atom now has this as a standard feature.

I cannot find any such standard feature in Atom - and Atom's documentation doesn't even know what line-ending conversion is.

'About Atom' tells me Atom is up-to-date with v.1.23.3

This, to me, seems a paradox.

(And no, I cannot just use Notepad++.)

I've looked around at a lot of solutions, but have not found one that will actually work.

like image 736
DaveC426913 Avatar asked Feb 05 '18 19:02

DaveC426913


People also ask

How do you change line endings in an Atom?

Changing a File's Line Ending You can click the line ending in the status-bar to open a modal with the line ending options. Selecting a different line ending will change each line of the file in the active editor.

What is line ending conversion?

A package that shows the current line ending (EOL) format of the active file and converts its EOL symbols to Windows/Unix/Old Mac format. williampuk. 1.3.2 42,795.

Is Atom going away?

We are archiving Atom and all projects under the Atom organization for an official sunset on December 15, 2022. When we formally introduced Atom in 2014, we set out to give developers a text editor that was deeply customizable but also easy to use—one that made it possible for more people to build software.

How do you show special characters in an Atom?

Displaying Invisible Characters in Atom To display spaces, tabs and linebreaks in Atom, you'll need to go to “Settings” -> “Editor” and then scroll down until you find the “Show Invisibles” option.


1 Answers

The built in line-ending-selector package supports this use case: https://atom.io/packages/line-ending-selector

The package's documentation describes how to do this:

You can click the line ending in the status-bar to open a modal with the line ending options. Selecting a different line ending will change each line of the file in the active editor.

Click

Change Line Ending

If you prefer to use the keyboard, you can also open the command palette (cmd-shift-p on macOS), type Convert and then use the Line Ending Selector: Convert to LF and Line Ending Selector: Convert to CRLF commands from there.

like image 200
nwinkler Avatar answered Oct 14 '22 10:10

nwinkler