Saving PhpStorm with a Linux line ending in Windows

Environment: Windows + PhpStorm

Problem : PhpStorm saves the file with the end of the Windows line - and it issues a script for the shell, so you should always convert it after copying to the server.

Question . Can I configure PhpStorm to save the file with the Linux line ending - \ninstead of \n\r(new line + carriage return)?

+4
source share
1 answer

You can safely use the line \nending for .php, as well as most other files - PHP on Windows will read these files just fine.


To set the final default line for all new files: go to Settings/Preferences | Editor | Code Styleand change the parameter Line separator (for new files)to the desired style (for example, Unix and OS X (\n)).

enter image description here


To change the line ending for a specific existing file: open the file and either change it through the appropriate section in the status bar .. or throughFile | Line Separators

enter image description here

enter image description here


PS

EditorConfig... . editorconfig file - , ( .. , PhpStorm).

/ IDE, .

+17

Source: https://habr.com/ru/post/1660103/


All Articles