Created
September 26, 2010 21:16
-
-
Save rondale-sc/598319 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
str = STDIN.read | |
out = '' | |
str.each_line do |line| | |
if line[0] == 35 | |
out << line | |
elsif line[0] != 35 | |
out << "#" + "\t" + line | |
end | |
end | |
puts "#commentStart-12x12x4141l1" + "\n" + out + "\n" + "#commentEnd-12x12x4141l1" + "\n" |
Awesome. Can't wait to see when you get farther on this.
Next iteration can be found here. http://gist.github.com/599183
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This should be added as a command in bundle editor.
commentStart-12x12x4141l1 -------- should be added to foldingStartMarker section in your ruby language bundle
commentEnd-12x12x4141l1 -------- should be added to foldingEndMarker section in your ruby language bundle
This will append and prepend the foldingStartMarker(i.e #commentStart) and foldingEndMarker(i.e. commentEnd) respectively to selected text. Which will allow folding in textmate. I'm going to work in some logic to get this to work on the entire document and make it toggle based on whether or not it finds the code after commentStart in the line, but this is pretty neat for cleaning up large comment blocks.