vim-stringify


Ⅰ. 插件描述

Turn your raw template into concated string

Ⅱ. 基本信息

创建日期:  2014-01-28
使用用户:  12
Github星:  30
插件作者:  Mike Li

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '29decibel/vim-stringify'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '29decibel/vim-stringify'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '29decibel/vim-stringify'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/29decibel/vim-stringify

Ⅳ. 文档说明

screenshots

About

vim-stringify is a small plugin that turns your raw templates into concatenated strings.

Here is your raw template :

<div class="post">
  <h1>By {{fullName author}}</h1>
  <div class="body">{{body}}</div>

  <h1>Comments</h1>

  {{#each comments}}
  <h2>By {{fullName author}}</h2>
  <div class="body">{{body}}</div>
  {{/each}}
</div>

:call Stringify() will turn it into this:

'<div class="post">' +
  '<h1>By {{fullName author}}</h1>' +
  '<div class="body">{{body}}</div>' +

  '<h1>Comments</h1>' +

  '{{#each comments}}' +
  '<h2>By {{fullName author}}</h2>' +
  '<div class="body">{{body}}</div>' +
  '{{/each}}' +
'</div>'

Installation

Install using vundle

Bundle '29decibel/vim-stringify'

Key mapping

map <leader>g :call Stringify()<CR>

Enjoy!

添加新评论