IRC regulars will know that you don’t paste code directly to the channel, but instead use a pasting service and post a link to where this service stores the paste.
TextMate of course has support for this, but recently this support reached new heights.
Then came along Brian Donovan and rewrote it to use the much better RAFB pasting service. He also made it ask the user which IRC channel the link should be sent to, making it far more useful for pastes not intended to go to #textmate.
This command has worked very well for quite some time, but recently three unrelated events happened:
Brad Choate created a set of commands to export the current document as HTML and convert the TextMate theme into equivalent CSS. This gives HTML which renders the code almost exactly as shown in TextMate.
Jacob Rus wanted to expand the targets for the pasting command from Colloquy to things like Adium, iChat, the clipboard, etc. and started to work on this.
Since Brad had already committed his commands to the TextMate bundle, Jacob had sent me the code he had already written for multiple destinations, and Josh was willing to work with me getting Pastie to accept an HTML variant for display purposes, the only thing left for me was to combine the three things, and so I did.
So the advantages of these combined efforts are:
- More destinations for the URL:
- Web Browser
- Syntax highlight as powerful as that found in TextMate with selectable theme.
- Much nicer pasting service: Cleaner look and supports UTF-8.
The only thing you need to do is select the text you want to paste and then press ⌃⌥⇧V. This will give you a list of potential targets for the resulting URL.
If you can’t remember the key equivalent then the command is located in the TextMate bundle reachable by either clicking the gear in the status bar or the Bundles item in the menu bar.
When you have located the TextMate bundle you will find an action named Paste Selection / Line to Paste Bin roughly in the middle of the menu.
Another way to reach this item is by using the Select Bundle Item… (⌃⌘T) from the Bundles menu and enter
paste or similar, to narrow the list.