How does one enforce a newline at end of file in RubyMine (v 4.5.3, on Mac OS)?
e.g., similar to Sublime Text 2
Asked
Active
Viewed 8,642 times
34

Marius Butuc
- 17,781
- 22
- 77
- 111
5 Answers
45
Enable Ensure blank line before end of file on Save option in the Editor
settings:

CrazyCoder
- 389,263
- 172
- 990
- 904
-
18In RubyMine 6, the label is "Ensure line feed at file end on save" – tee Dec 13 '13 at 15:48
7
In RubyMine 6 or above (on Mac OSX):
Enable 'Ensure line feed at file end on Save' option in the Editor
settings.

K M Rakibul Islam
- 33,760
- 12
- 89
- 110
4
RubyMine alongside many other editors supports the EditorConfig standard for basic configuration.
You can enforce newlines at the end of every file by placing a file named .editorconfig
at the root of your project:
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
It's possible to disable the setting for specific file types or filenames.

Leo
- 1,493
- 14
- 27
3
In RubyMine 2016.2.1 you have to go to Preferences > Editor > General > Other > Ensure line fedd at file end on Save
.
Screenshot of the Preferences in RubyMine 2016.2.1

Olga
- 31
- 1