This vim plugin will allow you to gist directly from vim, simple way is just :Gist to gist entire file more options in the Full Readme.

If you have not heard of gists or Github. Github is a very popular (especially with in the Ruby community) way of sharing open source code. Gists are the easy way to save and share small snippets of code.

Install

cd ~/.vim/plugin
wget --nocheck-certificate https://github.com/mattn/gist-vim/raw/master/plugin/gist.vim
cd ../doc
wget --no-check-certificate https://github.com/mattn/gist-vim/raw/master/doc/gist-vim.txt

#Now to set Your env variables
git config --global github.user your-name-here
git config --global github.token your-token-here

You Github token can be found on the GitHub Admin Account Admin tab.