Publishing a Blog in Vim with Vimpress

February 29, 2008

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.

Entry Filed under: Linux. .

8 Comments Add your own

  • 1. Dieter_be  |  March 1, 2008 at 5:31 am

    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. tim  |  March 1, 2008 at 5:46 am

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

  • 3. tamihania  |  March 1, 2008 at 9:49 am

    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. tamihania  |  March 1, 2008 at 10:08 am

    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. Dirk Gently  |  March 1, 2008 at 4:07 pm

    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. tamihania  |  March 1, 2008 at 5:08 pm

    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. tamihania  |  March 1, 2008 at 5:19 pm

    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. tamihania  |  March 1, 2008 at 5:45 pm

    …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

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Welcome to Tidbits.

Thanks for visiting. Helpful Linux Tidbits is a place for common bits of Linux knowledge and error fixes. Linux is an operating system that is growing at a fantastic rate and is exciting to be a part of - everyone can contribute to it. For the time being my posting will be limited as I try to find means to a new computer, unfortunately this may not be until October or November 2008.

I Enjoy the visit. Comments very very welcome.

Top Posts

Links

Subscribe

Atom Rss2

Creative Commons License