Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I strip trailing whitespace before each save in Cloud9?

Tags:

cloud9-ide

Cloud9 has a command under Tools called "Strip Trailing Space". I want to automatically run this command before every time I save a file, so I can be sure my files never contain trailing spaces. How is that done?

After frustratedly Googling for quite a while, I can find no documentation on how to achieve stuff like this. They claim Cloud9 is the most hackable IDE in the world though, so it ought to be possible.

like image 864
Hubro Avatar asked Jan 10 '15 21:01

Hubro


People also ask

How would you edit the builder PATH environment settings from within the Cloud9 IDE?

On the menu bar, choose AWS Cloud9, Preferences. To view the project settings for the current environment, on the Preferences tab, in the side navigation pane, choose Project Settings. To change the current project settings for the environment, change the settings you want in the Project Settings pane.

How do I get rid of whitespace trailing?

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 .

How do I save in Cloud 9?

To save the file, choose File, Save. Name the file fish. txt , and then choose Save.


2 Answers

Well this is embarrassing, but I combed through the preferences again and found the option On Save, Strip Whitespace under Cloud9 -> Preferences -> Code Editor (Ace).

like image 73
Hubro Avatar answered Jan 03 '23 21:01

Hubro


As of July 2015 it is under Cloud9 > "Open your Project Settings" in the top menu bar.

"general": {
    "@stripws": false
},
like image 27
paradigm111 Avatar answered Jan 03 '23 21:01

paradigm111