Here is a vim script that let’s you turn your website into a personal pastebin service so you can share text files with people. I’ll explain how it works and share some interesting ways to use it. Could be fun.
Why a personal pastebin?
Despite how we may appear sometimes, programmers are actually among the most social engineers. If you work around them long enough, you’ll need to share some code or the contents of some configuration file. It’s generally considered to be bad manners to send anything more than a line or two to someone in a chat client. For this reason, people have created pastebins. Just share a link where the contents are displayed and anyone interested can take a look.
I was using some other pastebin services for awhile, but the web interfaces are tedious to use. There are some good command line tools for hastebin with vim integration if you look for them and don’t mind using a public pastebin. But if you already have a webserver, why not use it to host your pastes? Here are the benefits of using the script:
- Share your code in just a few keystrokes.
- Use your own syntax hilighting and color scheme.
- Share anything that fits in a vim buffer, even a shell (more on that later)
- It’s a subtle way to promote your site among your friends.