May 9th, 2007

Blogging from VIM

For Vi, Vim or GVim users, there is a simple way to manage your blog posts. Under Vim environment, you can create new blog posts, edit, list all categories, list older posts, delete posts, turn Published into Draft posts, and vice-versa.
It is out-of-the-box working for Wordpress, but very easilly, you can make it manage Blogger, MovableType, TextPattern, etc, platforms. Its the beauty of Open Source software. Study the code, change it, and use it. It is very safe to use it because unlike proprietary software, you can check for “phone_home” procedures, etc.

Requirements:

- use a ruby enabled Vim. For Debian/Ubuntu, get it by doing a sudo apt-get install vim-ruby

How-To:

- copy the script to your Vim scripts path, $HOME/.vim directory
- edit you .vimrc (if not exists, create it: $HOME/.vimrc) and insert:

if !exists('*Wordpress_vim')
   runtime vimblog.vim
endif

- open the vimblog.vim script and edit the personal data in def get_personal_data method approx. at line 97.
- @site value, do not insert “http://”. Just insert the blog address, like in my case “blog.tquadrado.com”
- @xml value, insert the path to your blog’s xmlrpc.php file. If, like in my case, it is in / from your blog address, do insert “/xmlrpc.php”
- run Vim and try fetching the last 10 posts by doing:

:Blog rp

If  you can see them, it’s fine. If not, test this:

- check if the script is being found, by typing :B + TAB key. Upon code completion, it is ok. Remember, capital B.
- if error persist, check for the correct path for xmlrpc.php in @xml value.

Some jump to flickr screenshots at my Flickr account. Enjoy ;)

Pull it from my Github repository jump to github
or
Download script from vim.org and keep up with newer versions.

Forks:
update: if you need tags, you can get get it from Fernando repository at github.
update: another great forked version from Bryan at github.

pastie: