PageRenderTime 91ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/Commands/gsub - remove whitespace from front of line.tmCommand

http://github.com/drnic/ruby-tmbundle
Unknown | 32 lines | 30 code | 2 blank | 0 comment | 0 complexity | c49b3afeaca7d84ad23afe0b08b8b4fd MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3. <plist version="1.0">
  4. <dict>
  5. <key>beforeRunningCommand</key>
  6. <string>nop</string>
  7. <key>command</key>
  8. <string>#!/usr/bin/env ruby -w
  9. whitespace = ""
  10. if ENV['TM_CURRENT_LINE'] =~ /^([\s\t]+)/
  11. whitespace = $1.gsub(/\t/, '\t')
  12. end
  13. print "gsub(/${1:^#{whitespace}}/, '$0')"
  14. </string>
  15. <key>fallbackInput</key>
  16. <string>none</string>
  17. <key>input</key>
  18. <string>selection</string>
  19. <key>name</key>
  20. <string>gsub - remove whitespace from front of line</string>
  21. <key>output</key>
  22. <string>insertAsSnippet</string>
  23. <key>scope</key>
  24. <string>source.ruby</string>
  25. <key>tabTrigger</key>
  26. <string>gsub</string>
  27. <key>uuid</key>
  28. <string>B3875596-723C-41EE-9E6F-F84930C3B568</string>
  29. </dict>
  30. </plist>