1

Notepad++ has a setting for line endings so you can get \n instead of \r\n, but it still has the annoying behavior of omitting the terminator at the end of the last line. This makes it hard for me to collaborate with Windows users as they are always stripping the newlines from the ends of every file they edit.

Is there any editor I can suggest for them to use (another editor, or a Notepad++ plugin) that will be comfortable for people habituated to Windows, and save files in the correct format? I know of gvim for Windows but I think it may be a bit of a shock.

For background information on the formatting issue I'm talking about, see What's the point in adding a new line to the end of a file?.

  • 1
    There was an answer here... it led me to editorconfig.org, which was very useful. Almost a perfect answer, in fact. Now the answer is deleted. Whoever that was, thanks and if you put the same answer back, or a shorter version that just points to editorconfig, I'll give you the credit for it. If that doesn't happen I can do a self-answer – user26314 Sep 2 '16 at 18:22
  • Please do not add editorconfig.org as an answer, because you are looking for an editor and editorconfig.org is not an editor. Most likely the "answer" was not an answer but a comment like this. That could also be the reason why it was removed. Comments are transient and can vanish at any time. – Thomas Weller Sep 17 '16 at 20:22
1

You can use SynWrite and/or CudaText (new one) which both support Win, Unix line-endings, and encodings too (all changeable via click on status bar fields). CudaText has an option to force line-end to the last line.

SynWrite is open source and free. CudaText is released under Mozilla license

  • Please add a bit more information. Why do you recommend it? What's your personal experience with it? Link-only answers are not great answers and personally, I'd rather downvote than upvote. – Thomas Weller Sep 17 '16 at 20:19
1

I use Context

It is an old editor with color syntax and it's free (+ portable edition), but it can do exactly what you want:

enter image description here

  • Patrick, perhaps edit your answer and insert the image for better use. Also, I would suggest Hyperlinking Context and not just adding the URL :) Best of luck sir. – DankyNanky Nov 19 '16 at 2:21
  • Bonjour et Bonne Année a tous. Thanks for your help, but it's not easy for me to understand & explain all in English :) . Patrick – Patrick Jan 18 '17 at 12:41
1

CudaText editor can handle Unix ends good. Free, open source.

  • You need to use option in user.json "saving_force_final_eol": true,
  • And use statusbar click, to change line-end to Unix, or use option //End-of-lines: 1: Win; 2: Unix; 3: MacOS 9 "newdoc_eol": 2,
0

Gedit for windows will do the trick. It is open source and free (GPL).

  • Please add a bit more information. Why do you recommend it? What's your personal experience with it? Link-only answers are not great answers and personally, I'd rather downvote than upvote. – Thomas Weller Sep 17 '16 at 20:19
  • 1
    I second this. Gedit provides lines ending preference when you want to save your file. It supports Windows, Unix/Linux, and Mac OS Classic line endings. – meisyal Dec 19 '16 at 10:55
0

Use EditorConfig: http://editorconfig.org/#file-format-details

All editors that support it will do as you like automatically when you specify "insert_final_newline" parameter in your config.

(in particular, gedit supports it via a plugin, and Notepad++ too, and vim).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy