Change the EOL between CRLF, LF, and CR.

The end of the line is a symbol, which breaks the text lines into new rows. Many computer users don’t even realize that there is such a thing. It is invisible and it makes sense to be so because we don’t need to edit it.

However, it has 3 different formats which are CRLF, LF and CR.

For a normal user, it does not matter which one they’re using by default. But for programmers, this can be a real headache when the software stops working. As an example, in another post we have the same problem generated exactly by the EOL symbol.

What is the recommended EOL symbol?

Generally speaking, it depends on what you are doing. If your code will be running on Windows only, then probably crlf would make more sense. But if your code is going to be running on Linux, then it should be lf.

How to change the EOL in VSCode?

Open the desired file and in the bottom-right corner, you’ll find an indicator that shows the current EOL. Click on it and a menu will pop up. Select the new end of line symbol and save the file. That’s it.

The following screenshot illustrates the process:

How to change the EOL in Jetbrains IDE (PHPStorm, WebStorm, etc)?

In any Jetbrains IDE, the process is similar to what we did in VSCode.

Open the desired file and in the bottom-right corner, you’ll find an indicator that shows the current EOL. Click on it and a menu will pop up. Select the new end of line symbol and save the file. That’s it.

The following screenshot illustrates the process:

How to change the EOL in Sublime Text?

It’s a bit different from what we did in the above IDEs, but not too complicated.

Open the desired file and from the top menu select View -> Line Endings and then the Windows(CRLF) or Unix(LF). That’s it.

The following screenshot illustrates the process:

Member since January 2, 2019

Fullstack Web Developer with more than 12 years of experience in web development. Adept in all stages of advanced web development. Knowledgeable in the user interface, backend, testing, and debugging processes. Bringing forth expertise in design, installation, testing, and maintenance of web systems. Working exclusively and professionally with WordPress since 2010.

Comments

    Your email address will not be published. Required fields are marked *