vim-ember-hbs


Ⅰ. 插件描述

Ember Handlebars/HTMLBars plugin for Vim with indentation support

Ⅱ. 基本信息

创建日期:  2015-10-13
使用用户:  135
Github星:  42
插件作者:  Jouke van der Maas

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# vim-ember-hbs

vim-ember-hbs is a plugin to add Ember Handlebars/HTMLBars syntax highlighting and
indentation to Vim. It supports modern Ember Handlebars syntax like {{else if and
{{#each-in. An example of the highlighting (and indentation):

Badwolf theme
Solarized theme

Installation

The easiest way to install vim-ember-hbs is using the amazing Pathogen.
Simply copy/paste the following snippet:

cd ~/.vim/bundle
git clone https://github.com/joukevandermaas/vim-ember-hbs.git

Substitute .vim for vimfiles on Windows (in PowerShell).

Customization

The plugin defines a number of match groups that can be configured in a file at
$HOME/.vim/after/syntax/handlebars.vim. Those groups and there default highlight links are:

Please open an issue, if you are missing one.

hi link hbsBuiltInHelper Function         " all built in helpers like if, else, textarea, input, etc.
hi link hbsKeyword Keyword                " currently the only keyword supported is `as`
hi link hbsOperator Operator              " pencil () and argument =
hi link hbsDelimiter Delimiter            " the || in e.g. `{{#each foo as |bar|}}`
hi link hbsMustacheName Statement         " the name of a mustache `{{my-name`
hi link hbsPencilName Statement           " the name of a pencil `(my-name`
hi link hbsIdentifier Identifier          " everything thats inside a mustache or a pencil and is not a name nor an arg
hi link hbsString String                  " a "string" inside a mustache or a pencil
hi link hbsNumber Number                  " a 0135 number inside a mustache or a pencil
hi link hbsHandles Define                 " The mustaches handles {{
hi link hbsUnescapedHandles Identifier    " A handle with three braces {{{
hi link hbsUnescapedIdentifier Identifier " The identifier inside those {{{
hi link hbsComment Comment                " A comment {{!-- comment --}}
hi link hbsArg Type                       " An argument inside a mustache or a pencil

One can e.g. highlight all unescaped mustaches as Error with

hi link hbsUnescapedIdentifier Error

To also highlight the {{{ as Error, simply add

hi link hbsUnescapedHandles Error

添加新评论