Skip to content

Instantly share code, notes, and snippets.

@rondale-sc
Created September 26, 2010 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rondale-sc/598319 to your computer and use it in GitHub Desktop.
Save rondale-sc/598319 to your computer and use it in GitHub Desktop.
#!/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"
@rondale-sc
Copy link
Author

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.

@jnunemaker
Copy link

Awesome. Can't wait to see when you get farther on this.

@rondale-sc
Copy link
Author

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