├── info.plist ├── Commands └── Save Current File.tmCommand ├── README.mdown └── Macros └── Strip whitespace.tmMacro /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Whitespace 7 | ordering 8 | 9 | uuid 10 | 2FB97C0E-454B-4E8D-B5A1-FE0B9921381F 11 | 12 | 13 | -------------------------------------------------------------------------------- /Commands/Save Current File.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | input 8 | none 9 | name 10 | Save Current File 11 | output 12 | discard 13 | uuid 14 | A656F2AE-43BD-4DDE-9705-FF8C7E37F2B3 15 | 16 | 17 | -------------------------------------------------------------------------------- /README.mdown: -------------------------------------------------------------------------------- 1 | Whitespace TextMate Bundle 2 | ========================== 3 | 4 | This is a simple [TextMate][txm] bundle that strips out trailing whitespace and replaces tabs with spaces whenever a file is saved. Read more about it on the [Viget Labs developer blog][ext]. 5 | 6 | [ext]: http://viget.com/extend/out-damned-tabs 7 | [txm]: http://macromates.com 8 | 9 | ## Installation: 10 | 11 | mkdir -p ~/Library/Application\ Support/TextMate/Bundles 12 | cd ~/Library/Application\ Support/TextMate/Bundles 13 | git clone git://github.com/vigetlabs/whitespace-tmbundle.git Whitespace.tmbundle 14 | osascript -e 'tell app "TextMate" to reload bundles' 15 | 16 | *** 17 | Copyright (c) 2009 [Viget Labs][vgt], released under the MIT license 18 | 19 | [vgt]: http://viget.com 20 | -------------------------------------------------------------------------------- /Macros/Strip whitespace.tmMacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | argument 9 | 10 | action 11 | replaceAll 12 | findInProjectIgnoreCase 13 | 14 | findString 15 | \t 16 | ignoreCase 17 | 18 | regularExpression 19 | 20 | replaceAllScope 21 | document 22 | replaceString 23 | 24 | wrapAround 25 | 26 | 27 | command 28 | findWithOptions: 29 | 30 | 31 | argument 32 | 33 | action 34 | replaceAll 35 | findInProjectIgnoreCase 36 | 37 | findString 38 | ( )+$ 39 | ignoreCase 40 | 41 | regularExpression 42 | 43 | replaceAllScope 44 | document 45 | replaceString 46 | 47 | wrapAround 48 | 49 | 50 | command 51 | findWithOptions: 52 | 53 | 54 | argument 55 | 56 | beforeRunningCommand 57 | saveActiveFile 58 | input 59 | none 60 | name 61 | Save Current File 62 | output 63 | discard 64 | uuid 65 | A656F2AE-43BD-4DDE-9705-FF8C7E37F2B3 66 | 67 | command 68 | executeCommandWithOptions: 69 | 70 | 71 | keyEquivalent 72 | @s 73 | name 74 | Strip Whitespace 75 | uuid 76 | 59E6B2A2-6657-4628-B1EE-A00B38C46E5C 77 | 78 | 79 | --------------------------------------------------------------------------------