Pasting Services
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.
History
The initial version of the command was mostly proof-of-concept. It stored the paste using http://paste.textmate.org and then sent the URL to a channel named #textmate in Colloquy using AppleScript.
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.
-
Josh Goebel created a new pasting service called Pastie for various reasons.
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:
- Adium
- Clipboard
- Colloquy
- iChat
- Quicksilver
- Web Browser
- Syntax highlight as powerful as that found in TextMate with selectable theme.
- Much nicer pasting service: Cleaner look and supports UTF-8.
Instructions
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.