1
0
Fork 0

Add handlebars and youcompleteme

This commit is contained in:
Basti 2013-04-19 13:06:34 +02:00
parent 8215ebc2ad
commit 87657b70f0
9 changed files with 242 additions and 0 deletions

6
.gitmodules vendored
View File

@ -34,3 +34,9 @@
[submodule "bundle/textobj-user"]
path = bundle/textobj-user
url = git://github.com/kana/vim-textobj-user.git
[submodule "bundle/handlebars"]
path = bundle/handlebars
url = git://github.com/nono/vim-handlebars.git
[submodule "bundle/youcompleteme"]
path = bundle/youcompleteme
url = git://github.com/Valloric/YouCompleteMe.git

View File

@ -0,0 +1,20 @@
Copyright (c) 2011 Bruno Michel
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,38 @@
Vim plugin for Handlebars
=========================
About
-----
This plugin is here to help you editing
[Handlebars](http://www.handlebarsjs.com/) files.
Install
-------
**Install for pathogen**
cd ~/.vim/
git submodule add git://github.com/nono/vim-handlebars.git bundle/handlebars
vim bundle/handlebars/example.handlebars
**Manually Install**
git clone git://github.com/nono/vim-handlebars.git
cd vim-handlebars
cp -R ftdetect/* ~/.vim/ftdetect/
cp -R ftplugin/* ~/.vim/ftplugin/
cp -R indent/* ~/.vim/indent/
cp -R syntax/* ~/.vim/syntax/
vim example.handlebars
Credits
-------
Handlebars is the work of [Yehuda Katz](https://github.com/wycats).
This plugin was strongly inspired by [mustache.vim](https://github.com/juvenn/mustache.vim).
♡2011 by Bruno Michel. Copying is an act of love. Please copy and share.

View File

@ -0,0 +1,67 @@
<!DOCTYPE html>
<html>
<head>
<title>{{title}}</title>
{{!}}
</head>
<body>
<div id="common">
<h1>Mustache/Handlebars Showdown</h1>
Basic mustache {{hello}}
{{ hello}}, {{hello }} and {{ hello }} are OK
<de>{{d d d}}
{{Everything will be hilighted here}}
Mustaches hilighted in
<span class="color:{{awesome_color}};font-size:1.2em">attribute value</span>
{{#repo}}
This is an mustache [enumerable] section
<li>{{ name }}</li>
{{/repo}}
{{{ unescaped }}}
{{! <> this is a comment TODO:}}
This is a partial {{> partial1 }}
{{=<% %>=}}Sorry, cusomized delimiter not handled yet<%={{}}=%>
Thanks goes to {{@defunkt}}
Feedback/blames go to {{@juvenn}}
{{Frustrations}} go to /dev/null
</div>
<div id="handlebars">
<h1>Differences Between Handlebars.js and Mustache</h1>
Paths
{{person/name}} {{person.name}}
{{#person}}{{name}} - {{../company/name}}{{/person}}
Strings
<ul>{{#posts}}<li>{{{link_to "Post" this}}}</li>{{/posts}}</ul>
Hash
{{{link "See more..." href=story.url class="story"}}}
Helpers
{{#with story}}<p>{{{body}}}</p>{{/with}}
{{#each comments}}<p>{{{body}}}</p>{{/each}}
Conditionals
{{#if isActive}}
<img src="star.gif" alt="Active">
{{else}}
<img src="cry.gif" alt="Inactive">
{{/if}}
{{#unless isActive}}Inactive{{/unless}}
</div>
</body>
</html>

View File

@ -0,0 +1,3 @@
if has("autocmd")
au BufNewFile,BufRead *.handlebars,*.hbs set filetype=handlebars
endif

View File

@ -0,0 +1,10 @@
" Taken from https://github.com/juvenn/mustache.vim/blob/master/ftplugin/mustache.vim
if exists("loaded_matchit")
let b:match_ignorecase = 0
let b:match_words = '{:},[:],(:),'
\ . '\%({{\)\@<=[#^]\s*\([-0-9a-zA-Z_?!/.]\+\)\s*}}'
\ . ':'
\ . '\%({{\)\@<=/\s*\1\s*}}'
endif

View File

@ -0,0 +1,10 @@
" Handlebars indent
" Taken from https://github.com/juvenn/mustache.vim/blob/master/indent/mustache.vim
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
" Use HTML formatting rules.
runtime! indent/html.vim

View File

@ -0,0 +1,87 @@
" Handlebars syntax
" Language: Handlebars
" Maintainer: Bruno Michel <brmichel@free.fr>
" Last Change: Jun 23th, 2011
" Version: 0.1
" URL: https://github.com/nono/vim-handlebars
" Read the HTML syntax to start with
if version < 600
so <sfile>:p:h/html.vim
else
runtime! syntax/html.vim
unlet b:current_syntax
syntax clear Javascript
endif
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" Standard HiLink will not work with included syntax files
if version < 508
command! -nargs=+ HtmlHiLink hi link <args>
else
command! -nargs=+ HtmlHiLink hi def link <args>
endif
syn match hbsError /}}}\?/
syn match hbsInsideError /{{[{#<>=!\/]\?/ containedin=@hbsInside
syn cluster htmlHbsContainer add=htmlHead,htmlTitle,htmlString,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6
syn region hbsInside start=/{{/ end=/}}/ keepend transparent containedin=@htmlHbsContainer
syn match hbsHandlebars "{{\|}}" containedin=hbsInside
syn match hbsUnescape "{{{\|}}}" containedin=hbsInside
syn match hbsOperators "=\|\.\|/" containedin=hbsInside
syn region hbsSection start="{{[#/]"lc=2 end=/}}/me=e-2 containedin=hbsInside
syn region hbsPartial start=/{{[<>]/lc=2 end=/}}/me=e-2 containedin=hbsInside
syn region hbsMarkerSet start=/{{=/lc=2 end=/=}}/me=e-2 containedin=hbsInside
syn region hbsComment start=/!/ end=/}}/me=e-2 containedin=htmlHead contains=Todo
syn region hbsQString start=/'/ skip=/\\'/ end=/'/ containedin=hbsInside
syn region hbsDQString start=/"/ skip=/\\"/ end=/"/ containedin=hbsInside
syn match hbsConditionals "\([/#]\(if\|unless\)\|else\)" containedin=hbsInside
syn match hbsHelpers "[/#]\(with\|each\)" containedin=hbsInside
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_lisp_syntax_inits")
if version < 508
let did_lisp_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HtmlHiLink hbsError Error
HtmlHiLink hbsInsideError Error
HtmlHiLink hbsHandlebars Identifier
HtmlHiLink hbsUnescape Special
HtmlHiLink hbsOperators Operator
HtmlHiLink hbsConditionals Conditional
HtmlHiLink hbsHelpers Repeat
HtmlHiLink hbsSection Number
HtmlHiLink hbsPartial Include
HtmlHiLink hbsMarkerSet Number
HtmlHiLink hbsComment Comment
HtmlHiLink hbsQString String
HtmlHiLink hbsDQString String
delcommand HiLink
endif
let b:current_syntax = 'handlebars'

1
bundle/youcompleteme Submodule

@ -0,0 +1 @@
Subproject commit bdb88f7b76935febbda6a098430bdc9d44ff13c8