Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Atom text editor remove trailing whitespace on save

I use Sublime text. Now I am trying Atom. When I save any file in sublime text it does not include any trailing blank line. But saving any file in Atom leaves a trailing blank line. How do I force Atom not to leave trailing white spaces?

like image 762
Nasif Md. Tanjim Avatar asked Oct 15 '22 12:10

Nasif Md. Tanjim


People also ask

How do you get rid of trailing whitespace in an Atom?

The "Remove Trailing Whitespace" option is on by default. This means that every time you save any file opened in Atom, it will strip all trailing whitespace from the file. If you want to disable this, go to the whitespace package in your settings panel and uncheck that option.

How do you remove leading and trailing space?

To remove leading and trailing spaces in Java, use the trim() method. This method returns a copy of this string with leading and trailing white space removed, or this string if it has no leading or trailing white space.

What is trailing whitespace?

Trailing whitespace is any spaces or tabs after the last non-whitespace character on the line until the newline.

How do I delete a line in Atom editor?

Delete Whitelines is an Atom package for removing empty lines. Just Select the text, use command palette (cmd + shift + P) > delete-whitelines:toggle or alt+shift+D (for MAC & windows) to remove empty lines within the selected text area.


1 Answers

Under your Atom Preferences go to Packages tab and search for whitespace. Click on the whitespace package and uncheck Ensure Single Trailing Newline option

enter image description here

like image 203
Dan Moldovan Avatar answered Oct 18 '22 00:10

Dan Moldovan