summaryrefslogtreecommitdiffstats
path: root/ftplugin
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2013-09-12 17:34:37 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2013-09-12 17:34:37 +0200
commit2ed8751feb4e78fd37a822581a3ec4f7bfd627db (patch)
treec5686cab46f580a748d433c7c5272076dc588602 /ftplugin
parent3bd65161236bf5344619861fbe18b30f5bfd1a23 (diff)
downloadvim-polyglot-2ed8751feb4e78fd37a822581a3ec4f7bfd627db.tar.gz
vim-polyglot-2ed8751feb4e78fd37a822581a3ec4f7bfd627db.zip
Add handlebars templates support
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/handlebars.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/ftplugin/handlebars.vim b/ftplugin/handlebars.vim
new file mode 100644
index 00000000..c4a5dace
--- /dev/null
+++ b/ftplugin/handlebars.vim
@@ -0,0 +1,22 @@
+" Taken from https://github.com/juvenn/mustache.vim/blob/master/ftplugin/mustache.vim
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" Matchit support for Handlebars
+" extending HTML matchit groups
+if exists("loaded_matchit") && exists("b:match_words")
+ let b:match_words = b:match_words
+ \ . ',{:},[:],(:),'
+ \ . '\%({{\)\@<=#\s*\%(if\|unless\)\s*.\{-}}}'
+ \ . ':'
+ \ . '\%({{\)\@<=\s*else\s*}}'
+ \ . ':'
+ \ . '\%({{\)\@<=/\s*\%(if\|unless\)\s*}},'
+ \ . '\%({{\)\@<=[#^]\s*\([-0-9a-zA-Z_?!/.]\+\).\{-}}}'
+ \ . ':'
+ \ . '\%({{\)\@<=/\s*\1\s*}}'
+endif
+
+let &cpo = s:cpo_save
+unlet s:cpo_save