Home  >  Article  >  Software Tutorial  >  A simple way to set up eclipse to automatically delete blank lines and extra spaces after statements

A simple way to set up eclipse to automatically delete blank lines and extra spaces after statements

王林
王林Original
2024-06-11 13:05:37715browse

Have you ever encountered extra blank lines or spaces after statements in your code? This affects code readability and maintainability. PHP editor Xigua will introduce you to a simple method to help you automatically delete these redundant contents in Eclipse. By following this guide, you'll learn how to configure your Eclipse settings to automatically clean up excess blank lines and spaces when you save your code, keeping your code clean and organized.

1. Open eclipse, click [Window] on the toolbar, find the [Preferences] option in the pop-up list, and then click this option.

A simple way to set up eclipse to automatically delete blank lines and extra spaces after statements

2. The window that pops up now is the common settings window for JAVA developers. We click on [JAVA]>>[Editor]>>[Save Action] , and finally click the mouse on [Save Action].

A simple way to set up eclipse to automatically delete blank lines and extra spaces after statements

3. Check [Additional actions].

A simple way to set up eclipse to automatically delete blank lines and extra spaces after statements

4. Click [Configure...].

A simple way to set up eclipse to automatically delete blank lines and extra spaces after statements

5. The following interface will appear. Just check [Remove trailing whitespace] and select [All lines].

A simple way to set up eclipse to automatically delete blank lines and extra spaces after statements

6. Click [OK]

7. Click [Apply], and then click [OK] to complete the setting.

8. [Before setting].

A simple way to set up eclipse to automatically delete blank lines and extra spaces after statements

9. "After setting": Excess spaces will be removed after the file is saved.

A simple way to set up eclipse to automatically delete blank lines and extra spaces after statements

The above is the detailed content of A simple way to set up eclipse to automatically delete blank lines and extra spaces after statements. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn