chris blogs

July 2006

10jul2006 · Pastie Integration for Emacs: pastie.el

Pastie is the new cool code pasting site around the net. Totally nifty; heck, you can even post to it with Vim.

Having nothing better to do (heh… you bet), I just couldn’t resist but get the good old elisp out and write a few Emacs functions to make it accessible from Emacs, too.

Well, there you are: pastie.el.

pastie.el defines three new functions you may want to bind to appropriate keys:

  • pastie-region pastes the current region, shows the URL of the new paste and puts it in the kill buffer for immediate pasting.

  • pastie-buffer pastes the whole buffer.

  • pastie-get asks for a Pastie paste id and fetches it into an appropriate buffer.

Of course, all methods handle the various Pastie ways of syntax highlighting, provided you use the corresponding Emacs modes.

Happy pasting!

NP: Mark Knopfler—Everybody Pays

Copyright © 2004–2013