I’m a vim guy through and through. Always have been. But I’m no zealot. I say you use the tool that does the job. So for example, I’ve used xemacs on occasion, and it definitely has its strengths. But for day to day I’ve always come back to using vim. So when I setup this blog, I knew early on that if I was going to post at any sort of meaningful frequency, I would have to figure out how to do it through vim. Additionally I’ve grown accustom to mark up languages such as markdown & textile, so I knew I’d want to mix this capability in to both my blog & vim, as well.
NOTE: refer to these Wikipedia pages if you’re unfamiliar with vim, xemacs, markdown or textile.
Preliminary Step
Before we get started, make sure that your blog is configured to accept XML-RPC. This is a remote procedure call mechanism that allows external tools to submit posts to your blog. The option is underneath the site admin section of WordPress. You can get to the option under Settings –> Writing. The option looks like this:
Getting Started
After googling a bit I came across a plugin for vim called Blogit. The main developers page for Blogit is here, while the primary vim.org plugin page is here. The latest version at the time of this article was 1.3. Installation couldn’t have been simpler.
Installation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # get into vim's dot directory % cd ~/.vim # download Blogit % wget http://symlink.me/attachments/download/16/blogit-1.3.tar.bz2 # install blogit % tar jxvf blogit-1.3.tar.bz2 # ~/.vim directory should look similar to this % tree -A . └── plugin ├── blogit.vim └── mock_vim.py 1 directory, 2 files |
Configuration
The only other thing you need to do to setup the Blogit plugin is to create the following file: ~/.vim/plugin/passwords.vim. In it you’ll need to add 3 pieces of information about your blog. A username & password along with the URL to your blog’s xmlrpc.php file. Here’s an example:
1 2 3 4 | " login credentials for blog let blogit_username='user1' let blogit_password='password1' let blogit_url='http://www.lamolabs.org/blog/xmlrpc.php' |
Blogit’s Interface
After firing up vim, you can get a list of all the Blogit commands with the vim command Blogit help, like so:
You should get a split window in vim with the list of Blogit’s commands. BTW, most of these commands should be pretty self explanatory.
To get a list of all the posts available, run the command “Blogit ls”.
Again you’ll be presented with a list of all your blog posts, in a split window inside of vim.
You can use your arrow keys to move the cursor up and down through the list of posts. Additionally you can open posts up by placing the cursor on one, and pressing the enter key. In the example below, I’ve selected post#: 2362. Hitting return results in this particular post being opened up in vim’s primary window.
Here’s the results of post#: 2362 being opened.
Running the command “Blogit ls” again brings up the list of all the existing posts.
Mark Up Languages
As I mentioned previously I’m a big fan of mark up languages such as markdown & textile. For no other reason, than I just prefer it, I chose to use Textile. To enable Textile support within WordPress I installed the plugin Textile2. If you check out the WordPress Plugins Directory there appears to be a number of suitable textile plugins. Even though this particular plugin hadn’t been updated for sometime it has worked flawlessly for 8+ months under the latest versions of WordPress (i.e. 2.7 up to 2.8.4+).
Here’s a screenshot of Textile2′s configuration pane in WordPress:
Also to close one final loop, I installed the WordPress plugin WP markItUp!, on the off chance that I might actually use the web based editor for tweaking a post here or there. Installing this plugin basically switches the default WordPress editor out for one that can handle an assortment of mark up languages, Textile being one of them. Here’s a screenshot of post#: 2362.
Here’s how I configured the WP markItUp! plugin:
Conclusions
I’ve been using this setup for several months and it has just worked. I highly suggest you check it out if you maintain your own blog in WordPress and you too prefer working in vim.
NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.












Good work!
the Blogit seems great, I just manage to have Blogit works with a special patched GVim (which compiled with python2.6).
however, i am not able to get this working in Linux. I am using the latest GVIM, which is 7.2, with Blogit1.43, 1.42, 1.4 or 1.3.
none of them works, i see errors like “Cannot Import Name CalledProcessError”.
it is believed GVim is still built on Python2.4 that does not support some function/lib, but i haven’t found a patched version like that in Windows…
ok, here also come with a question: could you please share some info about which vim are you using? i really like to have the ability to blog under linux/vim
many, many, many thanks in advance…
I’m using vim & gvim version 7.2 on a Fedora 10 system, but I’ve had success on more recent versions of Fedora as well and also CentOS 5 too.
You might be having a problem with the vim package on your distribution of Linux. I encountered a problem where ruby support wasn’t compiled into vim and I needed to do this myself manually. Check out my blog post on Fixing Ruby Support in vim on Fedora 10, 11 and CentOS 5.