The VimPastebin script is a Vim plugin script that posts selected text to the Pastebin of your choice, and optionally sends the URL to your pasted text as message in Gajim to someone in your roster. The syntax is chosen from the current filetype in the Vim editor. For example, if you are editing a Python file, the text sent to Pastebin will automatically be highlighted with Python syntax.
This script is mostly written in Python, so it will only work if your Vim was compiled with the --enable-pythoninterp=yes configure option. To see if your installed Vim is compiled with this option, simply type the :version command inside Vim and look for +python. If you see -python in the list, this script will not work, otherwise you're golden!
Drop the script into your ~/.vim/plugin directory or somewhere else in your $VIMRUNTIME path. It will be sourced automatically next time you start Vim. You can source it manually by typing :source /path/to/script if you like.
There are a couple of configuration options in the script that should be modified for your particular settings. You can set your preferred Pastebin on line 38, and your preferred username on line 40. By default, the script included on this wiki page will post to http://pastebin.com as the user "vimuser".
To use the script is very simple. Just visually block ( Shift + V ) the lines of code you want to send to the Pastebin and enter the command :PasteCode. The blocked text will be sent to the Pastebin and the new URL will be shown on the Vim statusline. Optionally, you could enter the command :PasteGajim email@example.com to send the new URL to the JID firstname.lastname@example.org providing that JID appears in your roster. To make it even easier, you can send it to someone in your roster by only specifying their name, like :PasteGajim dcraven will send it to the user named 'dcraven'. This is handy if you cannot remember the person's full JID.