Ⅰ. 插件描述
Paste syntax code to webpage quicklyⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/yankcode'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/yankcode'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/yankcode'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/Yankcode
Ⅳ. 文档说明
Many times when I using my old blog system, I fell in bad mood when I have to mix my source code with content, or no support for source code like syntax highlighted. And when I use vims script TOhtml to deal with these thing, I feel that its handy, but still not enough convenient. I have to choose and copy the html code by my hand, then add a something like <quoteblock class=vimblock>(vimblock is a user-defined CSS element, will be mention later) tag to differentiate these code from common <quoteblock>. Its too inconvenient, also seems easy to be done with a script. So I wrote this.
With this script, pasting syntax code is only: "V"(selection) and ":Yankcode" and ctrl-v in editor.
The script based on TOhtml written by Bram Moolenarr. It convert the current selection to html using 2html, then get the body of html and wrap it with <blockquote class=vimblock>. In the end, it send the wrapped section of syntax code to clipboard for the further use.
Welcome any advice.