Ⅰ. 插件描述
Pimp up your templates with charismatic, overachieving, dynamically expansive place-holdersⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'tomtom/stakeholders'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'tomtom/stakeholders'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'tomtom/stakeholders'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/tomtom/stakeholders_vim
Ⅳ. 文档说明
Older templating plugins for VIM often used simple markup for
placeholders (e.g. <+VARIABLE_NAME+>). A placeholder was simply a
pattern you could easily search for. Some newer templating plugins (e.g.
xptemplate vimscript #2611) support dynamic replacement of placeholders
with the same name.
The stakeholders plugin turns your old templating system into a high
potential overachiever. It provides dynamic replacement of placeholders
for older templating plugins. By default, it assumes placeholders match
/<+([[:alpha:]_]+)+>/ since this pattern is used in several
templating systems. You can easily change that pattern by setting
|g:stakeholders#def| or b:stakeholders_def.
Usage~
The tskeleton templating plugin provides a parameter
(|g:tskeleton#enable_stakeholders|) that enables integration with the
stakeholders plugin. For other templating plugins, you have to enable
stakeholders by calling either |stakeholders#EnableBuffer()| or
|stakeholders#EnableInRange()|.
Demo:
http://vimsomnia.blogspot.com/2010/11/tskeleton-and-stakeholders-vim-plugins.html
Known issues~
- Replacing a visual selection by pasting text (using paste#Paste())
doesn't work. You have to delete the selection first and paste the
text afterwards.
Also available via git: http://github.com/tomtom/stakeholders_vim/
Status: Experimental
Install: See http://github.com/tomtom/vimtlib/blob/master/INSTALL.TXT
See http://github.com/tomtom for related plugins.