Skip to content
Browse files

Add spell check and handlebars syntax.

  • Loading branch information...
1 parent 7182325 commit efada819370b6525227d4c06f8e8a5ac7d7670bc @chrisrossi committed Mar 21, 2012
Showing with 106 additions and 4 deletions.
  1. +12 −0 spell/en.utf-8.add
  2. BIN spell/en.utf-8.add.spl
  3. +86 −0 syntax/handlebars.vim
  4. +8 −4 vimrc
View
12 spell/en.utf-8.add
@@ -0,0 +1,12 @@
+BRAC2
+metadata
+ACL
+DFA
+BRAC1
+ACEs
+UI
+McDonough
+URIs
+API
+JSON
+brac
View
BIN spell/en.utf-8.add.spl
Binary file not shown.
View
86 syntax/handlebars.vim
@@ -0,0 +1,86 @@
+" 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
+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'
View
12 vimrc
@@ -12,6 +12,7 @@ map <leader>q :qall<CR>
set t_Co=256
set cc=81
map <leader>w :bd<CR>
+set clipboard=unnamedplus
"Indents
set nosmartindent
@@ -23,10 +24,10 @@ set shiftwidth=4
autocmd BufWritePre *.py :%s/\s\+$//e
"Window Nav
-map <c-j> <c-w>j
-map <c-k> <c-w>k
-map <c-l> <c-w>l
-map <c-h> <c-w>h
+map <c-down> <c-w>j
+map <c-up> <c-w>k
+map <c-right> <c-w>l
+map <c-left> <c-w>h
"Navigating buffers
let g:miniBufExplModSelTarget = 1
@@ -53,6 +54,9 @@ map <leader>r :RopeRename<CR>
"TagList
map <leader>t :TlistToggle<CR>
+"Handlebars
+au BufRead,BufNewFile *.handlebars,*.hbs set ft=handlebars
+
" Add the virtualenv's site-packages to vim path
py << EOF
import os.path

0 comments on commit efada81

Please sign in to comment.
Something went wrong with that request. Please try again.