15

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.

2 Answers 2

21

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.

5

Go to Preferences under Atom menu. Uner the settings window, go to Packages. In packages search on line-ending-selector. This reveals a core package that is loaded with Atom. Scroll down the line-ending-selector page and you see the header Settings. Below that you can choose the default line endings. You can choose LF, CNTL-LF, or OS. Set this to the value you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.