1

I can go to Edit > EOL conversion and choose the desired one, but not all other files have this.

How could I lock it to ensure it will be the default EOL conversion for all files whatever? Or at least, for all files from a given language?

  • Please what do you mean by "not all files have this"? And what N++ version you are using? – miroxlav Jan 2 '17 at 4:39
  • I'm talking on all files whatsoever because I usually work with Unix files and I really don't care that a few Windows files will have Unix EOL. I've edited the question. – JohnDoea Jan 2 '17 at 4:43
0

Using EditorConfig plugin:

Your requirement could be probably achieved using EditorConfig N++ plugin which supports end-of-line settings like

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

The setting on 3rd line should do what you expect. Check the above hypelink to learn more.

The plugin is available for automatic download and installation through N++ menu Plugins > Plugin Manager.

Without plugins:

Please do not expect your requested functionality from Notepad++ core (without plugins) because what you expect is automatic conversion of line endings when file is open in Notepad++. But N++ preserves content of files instead of automatically changing it without user notice. If it was doing automatic changes, someone would expect automatic change of encoding when file is open, someone automatic change of tabs/spaces, someone change of indentation... This would lead nowhere.

The easiest way without plugins is to open Settings > Shortcut Mapper and in section Main find command Convert to UNIX format and assign that command a keyboard shortcut. Then you can have your conversion made on pressing a hotkey.

Your Answer

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

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