Yankcode


Ⅰ. 插件描述

Paste syntax code to webpage quickly

Ⅱ. 基本信息

创建日期:  2007-03-09
使用用户:  1
Github星:  1
插件作者:  Sheng Yang

Ⅲ. 安装方法

使用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 vim’s script TOhtml to deal with these thing, I feel that it’s 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>. It’s 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.

添加新评论