Ⅰ. 插件描述
A Vim Plugin for Blogging in Wordpress (incl. wordpress.com)Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'mrpeterlee/vimwordpress'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'mrpeterlee/vimwordpress'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'mrpeterlee/vimwordpress'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/mrpeterlee/vimwordpress
Ⅳ. 文档说明
# About
This is a fork of the VimBlog project, located at: https://github.com/danielmiessler/VimBlog
And VimBlog was a fork of the VimRepress project, located at: https://github.com/vim-scripts/VimRepress
VimWordpress is a Python 3 plugin for Vim to manage Wordpress (incl. wordpress.com) blogs. As of 2016, other vim plugins lack the support of Python 3, which motivates the development of the VimWordpress plugin.
Requirements
- Vim 8+ with Python 3.3+ support (Python 2 support is dropped)
- Python 3 Environment matched wtih Vim's support ("has(python3)" return 1 in vim)
- python-markdown/python-markdown2 installed (execute "pip install markdown2" in shell)
- Wordpress 3.0.0 +
Updates
2020-01-30
- Replaced SafeConfigParser with ConfigParser per deprecation requirement for Python 3.2+
- Fixed an issue in BlogOpen
Installation
Use Vundle to add mrpeterlee/VimWordpress to the Plugin source.
Plugin 'mrpeterlee/VimWordpress'- Create a ~/.vimpressrc file, and put the following in it
[Blog0]
blog_url = https://yoursite.com/
username = your_user_name
password = your_passwordCommand Examples
Some commands list above contain special usage, example below may clearify them for you.
:BlogList - List 30 recent posts.
:BlogList page - List 30 recent pages.
:BlogList post 100 - List 100 recent posts.
:BlogNew post - Write an new post.
:BlogNew page - Write an new page.
:BlogSave - Save (default to published).
:BlogSave draft - Save as draft.
:BlogPreview local - Preview page/post locally in your browser.
:BlogPreview publish - Same as `:BlogSave publish' with brower opened.
:BlogOpen 679
:BlogOpen http://your-first-blog.com/archives/679
:BlogOpen http://your-second-blog.com/?p=679
:BlogOpen http://your-third-blog.com/with-your-custom-permalink
Commands
A few shortcuts was recommended in VimBlog for day-to-day blogging:
Starting workflow
From the shell I launch these two character shortcuts to begin blogging immediately.
alias nb="vim +BlogNew"
alias eb="vim +BlogList"Inside Vim
Once inside Vim I can run these.
nnoremap <leader>b :BlogSave publish<CR>
nnoremap <leader>h :set ft=HTML<CR><CR>Default to publish as "private"
Wordpress defines three types of posting: "draft", "private", "public", and VimWordpress defaults to "private" after ":BlogSave".
Credits
All credit to Pentie for creating VimRepress, which this is based on.