Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Do not automatically trim end of line white space #27

Closed
gabriel-r opened this issue May 20, 2014 · 5 comments
Closed

Do not automatically trim end of line white space #27

gabriel-r opened this issue May 20, 2014 · 5 comments

Comments

@gabriel-r
Copy link

When opening a file, all white space at the end of each line is trimmed.
This is quite annoying when diffing changes.

5psq4r_views_py__views_py_-_sourcegear_diffmerge

@gabriel-r gabriel-r changed the title Do not automatically trim white space on empty lines Do not automatically trim end of line white space May 20, 2014
@izuzak
Copy link
Contributor

izuzak commented May 20, 2014

@gabriel-r Sorry for the confusion! This behavior is controlled by the Whitespace package which is included by default with Atom.

You can turn off this trimming by going to Atom > Preferences, and then scrolling down until you see the Whitespace package. Click on the package and you will be able to either disable the package entirely, or use the provided config options to disable just the "Remove trailing whitespace" feature.

@izuzak izuzak closed this as completed May 20, 2014
@gabriel-r
Copy link
Author

Thanks for the clarification!

@jacksonbicalho
Copy link

Disabled ignore whitespace only lines in PackagesWhitespace.

fergunet referenced this issue in JJ/modeling-volunteer-computing Aug 9, 2015
@ziru
Copy link

ziru commented Sep 17, 2015

I disabled the "Remove Trailing Whitespace" option from the Whitespace package. I did notice a menu item for this action on demand. Just curious whether it is possible to add a keybinding for doing this?

@izuzak
Copy link
Contributor

izuzak commented Sep 17, 2015

I disabled the "Remove Trailing Whitespace" option from the Whitespace package. I did notice a menu item for this action on demand. Just curious whether it is possible to add a keybinding for doing this?

@ziru Yeah, that should be possible. For example, add this to your keymap.cson:

'atom-text-editor':
  'ctrl-alt-y': 'whitespace:remove-trailing-whitespace'

Also check out these docs:

https://atom.io/docs/latest/using-atom-basic-customization#configuring-with-cson
https://atom.io/docs/latest/using-atom-basic-customization#customizing-key-bindings
https://atom.io/docs/latest/behind-atom-keymaps-in-depth

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants