11 Comments

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 http://linuxtidbits.wordpress.com/xmlrpc.php. 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.

About these ads

About Gen2ly

<3's linux

11 comments on “Publishing a Blog in Vim with Vimpress

  1. Your link to vimpress is broken.

    If anyone is interested in doing the same but with drupal, I found some interesting stuff here:
    http://drupal.org/node/295
    http://www.petersblog.org/node/465
    http://www.petersblog.org/node/876

    On the other hand, having vim embedded into firefox would be *really* nice. An effort into that direction can be found @ http://garoth.com/?p=10

  2. That’s interesting. What’s the font in the terminal on the screenshot?

  3. 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,
    tami

  4. 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
    tami

  5. 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:

    :.!ls

    Desktop
    My Documents
    My Music
    My Pictures
    Storage

    tim,

    the font in Bitstream Vera Sans Mono

  6. 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””

  7. 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,
    tami

  8. …and just in case it’s still not clear – here is the link to the screen shot of the part of my .vimrc in question:

    http://tamilinux.wordpress.com/2008/03/02/some-useful-vim-shortcuts/

    Hope it helps,
    tami

  9. 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.

    Title : WORDS : DESCRIPTIONS
    |–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?

    thanks,

  10. 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.

  11. [...] closetag script Vimpress repository Similar article i used as reference Share this:TwitterFacebookLike this:LikeBe the first to like this [...]

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 52 other followers

%d bloggers like this: