[TxMt] Remove trailing spaces and tabs
Scott Haneda
talklists at newgeo.com
Thu Apr 2 05:57:18 UTC 2009
Hello, I found a .tmMacro file someone put up, it will allow me to
remove trailing spaces and tabs on save. Works nice, for one flaw.
If I have any text selected, that selected text is replaces with what
seems to be the contents of the entire file.
I can not figure out how to even edit the .tmMacto once installed. I
can put the cursor in the bundle editor area, but it will not allow
any chances.
I can not open the .tmMacro file in TM, so I could use the shell, but
that seems strange, and it is a plist, and not entirely sure what to
edit.
The Macro has two commands
executeCommandWithOptions
{
beforeRunningCommand = nop;
command = "perl -pe 's/[\\t ]+$//g'";
input = document;
output = replaceSelectedText;
}
executeCommandWithOptions
{
beforeRunningCommand = saveActiveFile;
input = none;
output = discard;
}
* I can sort of hack this out on my own by making a empty command,
then recording a macro to and hooking those two together. The above
seems cleaner though.
Any ideas what I should edit? The perl seems fine, a direct copy from
the TM built in to remove spaces and tabs, maybe the output =
replaceSelectedText; needs changing?
--
Scott * If you contact me off list replace talklists@ with scott@ *
More information about the textmate
mailing list