malwk (malwkgad) wrote,

Livejournal integration with Vim 7.x

I have played aroun with PyLjVim script to tune it for better intergation with my workflow.

Here are the changes I have introduced to make it easier to work with:
  • Instead of always loading the macros (:LJ*) add :au command for *.lj filenames to source the macros file
  • Changed macros file to use current file instead of creating new buffer and to keep the buffer after posting to LiveJournal servers
  • Edited macros file to set filetype to livejournal to match snippet file (see bellow)
  • Source ~/.vim/after/lj.vim from macros file, in after file add settings for closetag vim plugin to be used in LJ posts as html is supported and then source the closetag plugin, invoke LJTemplate also to load template in current buffer
  • Edited pyljpost.py python script to support tags when posting, tags and pictures implemented as snippets (see bellow)
  • Added snippet file for LiveJournal filetype to implement links, quotes, code and tags/pictures

File listing (all files can be downloaded - see link at the end of the post):
~/.vim/ftdetect/livejournal.vim
au BufRead,BufNewFile *.lj nested source ~/.vim/macros/pyljpost.vim

~/.vim/after/lj.vim

let b:closetag_html_style=1
let b:unaryTagsStack="br"
source ~/.vim/plugin/closetag.vim
LJTemplate


It is now much easier and more convenient to post to LiveJournal from withing Vim than it was originally designed by its author, I dare say. All related files can be found on the usual place.
Tags: gnomedesktop
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded  

  • 2 comments