Using Blogit Vim Script To Manage Your WordPress Site

Posted on: July 23rd, 2012 by No Comments

This is a cool little script that I just recently came across which allows you to manage your WordPress articles using vim. I can imagine the mere proposal of editing your WordPress posts using the familiar vim interface will send satisfying chills through the spines of CLI lovers like me.

Setup Blogit Today

So here I will teach everyone how to setup and get started using this Vim script with just a few simple steps. Then you will soon be able to publish posts and pages to your WordPress site, or edit existing pages.

Blogit Vim Script Screenshot

Manage WordPress With Blogit

You can also use this Vim script to remove existing posts from your WordPress site. I hope everyone enjoys this great little tool as much as I have.

Warning: Users wishing to try this script should use care. This project does not appear to be maintained on a regular basis.

Blogit Vim Script Setup


First you have to download the package from their website, a link is available at the bottom of the page. Decompress the downloaded package into your .vim directory. This folder is usually located inside the home directory of the current user, though it may be hidden Now create a file called password.vim and place it in your .vim directory as well. This is what the file should contain:

let blogit_username='Your blog user name'
let blogit_password='Your blog password'
let blogit_url='https://your.blog/xmlrpc.php'

Using Blogit Vim Script


This script is not very difficult to use. Here are some tips to get you started.

Start Vim First

Now just open vim with the following commands. All Vim commands still function when using Blogit.

$ vim

Start The Script

Next you should run the script inside the Vim interface using the next commands.

:Blogit command

Blogit Commands


Below you can see several commands that are available for this Vim script.

List All Blog Posts

Use this command to list all posts from the specified blog.

:Blogit ls blog

Creat New Blog Post

This command will create a new post on the specified blog.

:Blogit new blog

Save As Blog Post

Text in the buffer will be saved as a blog post.

:Blogit this blog

Edit Specified Post

Edit post with the specified ID number. The ID is simply the post page number on your WordPress site.

:Blogit edit id blog

Edit Specified Page

Edit page with the specified ID number.

:Blogit page id blog

Another Saving Method

This is another save method. Unfortunately I am not sure which is which.

:Blogit commit

Publish Specified Post

Use this to publish the current article.

:Blogit push

Save Post As Draft

Unpublish the current article, the article will then be saved as a draft.

:Blogit unpush

Remove Specified Post

Remove the post with the specified ID number from your WordPress site.

:Blogit rm id

Update Tags And Categories

An updated list of tags and categories will be generated.

:Blogit tags

Preview Post In Browser

You can even preview an article in your browser with this simple command.

:Blogit preview

See Help Documentation

See the Blogit Vim script help information.

:Blogit help

Previous Issues With Blogit Vim Script


I have been encountering a few rather huge issues with this script. Vim has the tendancy to remove or distort all HTML tags when saving posts to WordPress. This will leave HTML inside posts looking as follows.

h2titleh2

Download Blogit

Helpful Links

Tags: , , | Posted in Command Line