Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove trailing whitespace in PyDev plugin for Eclipse

Ideally, eclipse should remove all trailing whitespace when I save the file. I know there is option for this in C++/Java plugins for eclipse, but I couldnt find one for PyDev. Is there one? If not, whats the easiest way to achieve this?

like image 202
vinodkone Avatar asked Oct 12 '11 17:10

vinodkone


People also ask

How do you get rid of trailing white space?

Type M-x delete-trailing-whitespace to delete all trailing whitespace. This command deletes all extra spaces at the end of each line in the buffer, and all empty lines at the end of the buffer; to ignore the latter, change the variable delete-trailing-lines to nil .

What does trailing whitespace mean?

Trailing whitespace. Description: Used when there is whitespace between the end of a line and the newline.

How do I fix trailing spaces in Python?

Python String strip() function will remove leading and trailing whitespaces. If you want to remove only leading or trailing spaces, use lstrip() or rstrip() function instead.


1 Answers

Check in:

Preferences > PyDev > Editor > Code Style > Code Formatter

and check the "Right trim lines?" check box.

like image 54
TorelTwiddler Avatar answered Sep 19 '22 06:09

TorelTwiddler