Publishing a Blog in Vim with Vimpress

Publishing a Blog in Vim with VimpressI like blogging. :)

I learned though that writing blogs is an art in organization and learning the tools used to make them. I reviewed blogging software before and said that I really liked Drivel. This week though may have changed all that. I decided to crash test Vimpress and test how she does. Now, I can say I’m really impressed. I am very possibly going to keep using it.

Vimpress is a plugin for Vim that allows editing and added posts to WordPress blogs. Vimpress also will list the posts written to easily go back and edit them. Blogging is as simple as BlogList, BlogNew, BlogOpen and BlogSend. Installation is easy enough, just put the blog and syntax file in their respective folders:

tar zxvf vimpress.tar.gz -C ~/.vim

Edit ~/.vim/plugin/blog.vim to point to WordPress php-file. Mine for example is And Vimpress will be ready. For more look at Vimpress’s homepage.

After I set it up, Typing in Vim and publishing in Vimpress does so without a hitch. Very nice. A couple things to keep in mind to help ease the transition…

Html markup will have to be learned. Only the basic tags need to be learned though (a href, img, pre…) not too bad. Also I find that the closetag plugin is a good idea. The closetag plugin maps ctrl-_ to close the tag. A few lines will need to be added to the ~/.vimrc for it to be active:

" Automatic tag closing for html and xml (closetag plugin)
autocmd Filetype html,xhtml,xml,xsl source ~/.vim/scripts/closetag.vim
let g:closetag_html_style=1
source ~/.vim/scripts/closetag.vim

Vimpress comes with a syntax file that highlights the BlogList and header, if html syntaxing is desired its easy enough to set:

:setfiletype html

I was hoping to find a way to nest html in the syntax file but haven’t just yet found out how.

Publishing a Blog in Vim with Vimpress

Anyways, I’ve really liking using Vim and Vimpress so far. As I’ve said previously the learning scale is a bit more but well worth it. I need to learn some more about cutting and pasting in Vim (to and from the Xserver) to really be effective but I’m getting there.

11 thoughts on “Publishing a Blog in Vim with Vimpress

  1. tamihania

    Very interesting and thorough entry – thanks for sharing it!
    As to copying and pasting from X to vim in terminal:

    I personally use selecting text in X (mouse or keyboard) and then in vim
    :set paste
    and simply either middle click or Shift+Insert in Insert mode.

    I have mouse enabled in vim.

    I also mapped :set paste in my .vimrc like this:
    map :set paste!:set paste?
    imap :set paste

    Have a nice weekend,

  2. tamihania

    PS. Just as a reminder (I think you know it already) – one can also use any standard built-in shell command in vim – like cp, cat, echo, etc. It’s enough to prefix them with ” ! “.
    All the best again

  3. Dirk Gently Post author

    Fixed broken link, thanks.

    Pretty cool paste tip,though .vimrc is a bit odd. Are those mapped to a key?

    map :set paste!:set paste?
    imap :set paste


    I just discovered another interesting bit about paste: prepending a . to ! will print the terminals output to vim:


    My Documents
    My Music
    My Pictures


    the font in Bitstream Vera Sans Mono

  4. tamihania

    uups – somehow (html probably…) my paste from .vimrc did not show in the comment LOL. I try once again and than I will try to simply describe it.
    Well, the paste:

    map “” :set paste!””:set paste?””
    imap “” “”:set paste””

  5. tamihania

    ok – html is in a way – so – this should look like this:

    map “F2″ :set paste!”CR” :set paste?”CR”
    imap “F2” “C-O”:set paste”CR”

    Instead of (” ” ) signs use the brackets you usually use to code in html (more/less signs)…

    Sorry for this – I simply did not notice that the code was not there first time I posted here.

    I hope it will work now…
    All the best,

  6. will

    hello there,
    once i read about this, i try it, and i like it. good post anyway.

    but there’s one question now. in the “Title” section of Meta, if the title consist of 2 parts, separated by the colon ( : ) char, e.g.

    |–1ts—| : |——–2nd——-|

    when i command ‘BlogSend’, then i view the result in browser, strangely, the 2nd part of the title is disappear. what’s wrong? have you try this kind of writing in the “Title” ? i keep back to wordpress just to edit these kind of title.
    It looks like when i use colon ( : ) char, vimpress only send the 1st part (left of colon) not those 2 parts.
    have you any idea why?


  7. Dirk Gently Post author

    No but thanks for reading. I don’t usually don’t do colons but if this is a reoccurring problem tell the author about it so it’ll get fixed.

  8. Pingback: WordPress inside of Vim inside of OpenSUSE « Bored out of my mind.

Leave a Reply to tamihania Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s