Here's the TM command to go with cleanup_whitespace.py. It works on selected text, but falls back to the whole document if none available. Changed: D trunk/Bundles/Python.tmbundle/Support/clean_whitespace.py A trunk/Bundles/Python.tmbundle/Support/cleanup_whitespace.py U trunk/Bundles/Python.tmbundle/info.plist