So what would I need to do to bind this "Text / Remove Trailing Spaces in Document" + "Save" to, say F3 (that is what I've F3 defined to in Nedit on Linux to do the same)?
Cheers, Fons.
Dan Ridley wrote:
There's a command - Text / Remove Trailing Spaces in Document. You could bind that, or your macro, to Cmd-E (right next to S on the keyboard), so you could remove spaces and save by holding Cmd and tapping E-S.
If you really want to get it into one command, you can use this:
perl -pe 's/[\t ]+$//g' > "$TM_FILEPATH" && cat "$TM_FILEPATH"
(Input: Entire Document Output: Replace Document)
There are two problems with this, though:
- TextMate will not know that you've overwritten the file, so while the
file contents on disk will match the file contents in TextMate, you'll still get the "unsaved" bullet on your tab, and will be prompted to save on close.
- You'll be returned to the beginning of the current line when you run it.
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate