I wonder if besides the default preference, the "strip/leave trailing spaces" can be changed for individual files when saving. If so, how?
I don't want a configuration file in the same directory (where other text files live). Ideally I would like to have some option somewhere before saving the file.
Of course, I can always change the preferences, save the file and then change back the preferences, but that seems rather cumbersome.
On 30 Jul 2019, at 19:27, Nestor Aguilera wrote:
I don't want a configuration file in the same directory (where other text files live). Ideally I would like to have some option somewhere before saving the file.
Using EditorConfig does unfortunately require adding an .editorconfig file somewhere, but according to https://editorconfig.org/, it can be in any parent folder of the file you’re customizing.
So one option would be to create a central .editorconfig file in your home folder, like this:
[projects/text_files/my_file.txt]
trim_trailing_whitespace = true
You’d only have to worry about the .editorconfig file if you moved or renamed my_file.txt.
(I haven’t tested this in BBEdit, but it should work according to the EditorConfig spec.)
Hope this helps!
-sam
As I said, it is no big deal as I can always change the global preferences, save the file and then change back the global preference.
… after applying the filter you sent me it seems that (a) the file is not saved, and (b) the trailing spaces **are** trimmed, which is exactly the opposite of what I want (save the file with whatever white trailing space it has).
What am I doing wrong?
So perhaps I could create say a "data" language module for files with extension ".dat", having the default text file behavior except for the stripping of trailing whitespace.
This way I could avoid Applescript completely.
Now the question is: how to I create the "data" language module?
The BBEdit manual also mentions "Packages" on page 349, but that is even more cryptic to me.

--
This is the BBEdit Talk public discussion group. If you have a
feature request or need technical support, please email
"sup...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <https://www.twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/FED26650-1D45-4A9B-8E86-2DECF7DBA6A0%40suddenlink.net.
1. Take a script like Chris’s that deletes end of line whitespace, and attach it to the Save menu command (see manual for how to attach).