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.
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.
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.
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'
This script is not very difficult to use. Here are some tips to get you started.
Now just open vim with the following commands. All Vim commands still function when using Blogit.
Next you should run the script inside the Vim interface using the next commands.
Below you can see several commands that are available for this Vim script.
Use this command to list all posts from the specified blog.
:Blogit ls blog
This command will create a new post on the specified blog.
:Blogit new blog
Text in the buffer will be saved as a blog post.
:Blogit this blog
Edit post with the specified ID number. The ID is simply the post page number on your WordPress site.
:Blogit edit id blog
Edit page with the specified ID number.
:Blogit page id blog
This is another save method. Unfortunately I am not sure which is which.
Use this to publish the current article.
Unpublish the current article, the article will then be saved as a draft.
Remove the post with the specified ID number from your WordPress site.
:Blogit rm id
An updated list of tags and categories will be generated.
You can even preview an article in your browser with this simple command.
See the Blogit Vim script help information.
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.