写blog之 vimpress

周末闲来无事, 去试了一下damon说的vimpress,不试不知道,还真是方便,安装完顺手写了篇日志。

先去下载vimpress:
http://www.vim.org/scripts/script.php?script_id=1953

我根据前辈们的代码做了一些修改:
blog.vim

把文件放到vimfiles 下, 在blog.vim 中配置对于的用户名,密码以及xmlrpc地址
好了, 去你的网站上运行xmlrpc吧。可以开始使用vimpress.

有几个命令:

 :BlogList
  Lists all articles in the blog
 :BlogNew
  Opens page to write new article
 :BlogOpen 
  Opens the article  for edition
 :BlogPub
  Saves the article to the blog for publish
 :BlogDraft
  Saves the article to the blog as a draft
 :BlogCat
  get category list
 :BlogUpload file_path
   upload the file in the path

试试吧:

:BlogNew

"修改对于的Meta信息
"Title : 写blog之 vimpress
"Cats  : vim
"Tags  : vim

" 保存为草稿
:BlogDraft
" 发布
:BlogPub

由于公司的网络中要代理才能上网, 我加了代理,不需要的同学可以考虑把代理部分去掉。
关于文件上传,在写这边文章的时候, 我上传了blog.vim, python报错了,后来还是改成了blog.txt 来上传.
看来部分文件后缀是无法上传的。

参考资料:
http://docs.python.org/tutorial/errors.html
http://www.xmlrpc.com/
http://docs.python.org/library/xmlrpclib.html

Leave a Comment