vim-stencil


Ⅰ. 插件描述

simple template loading plugin for VIM

Ⅱ. 基本信息

创建日期:  2014-07-22
使用用户:  7
Github星:  7
插件作者:  Daniel Schauenberg

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# vim-stencil

Overview

VIM plugin to load templates from a directory and do basic variable substitution.

Installation

If you don't have a preferred installation method, I recommend installing
pathogen.vim, and then simply copy and paste:

cd ~/.vim/bundle
git clone git://github.com/mrtazz/vim-stencil.git

Usage

Set the path where to find the templates like this:
let g:StencilTemplatepath = "~/.vim/templates/"

Then you can load templates with the :Stencil command. It supports tab
completion for choosing the template. The template loader will always load the
template after the first line of the file.

Variable expansion

Stencil supports expansion of some simple variables. Those are:

  • %%DATE%% will be replaced by the current date in the format mm/dd/yyyy
  • %%WEEKDAY%% will be replaced by the full name of the weekday (e.g. Friday)

添加新评论