Guest User

Untitled

a guest
Apr 25th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 2.17 KB | None | 0 0
  1.   1 <!doctype html public "<!doctype html">
  2.   2 <head>
  3.   3   <meta charset=utf-8>
  4.   4   <title>Blag</title>
  5.   5   <link rel="stylesheet" href="/assets/style.css">
  6.   6 </head>
  7.   7 <body>
  8.   8   <section id=main>
  9.   9     <header id=header>A blog by moshee about things and stuff.</header>
  10.  10     {{range .}}<article>
  11.  11       <h1>{{.Title}}</h1>
  12.  12       <div class=timestamp>Posted on <time>{{.Date}}</time></div>
  13.  13       <div class=comment-pointer>{{.Id}}</div>
  14.  14       <p>{{.Content}}</p>
  15.  15     </article>{{end}}
  16.  16     <footer id=footer>wat</footer>
  17.  17   </section>
  18.  18 </body>
  19. ~
  20. template.html [+]                                                                                                     4,6-7          All
  21.   1 " Vim syntax file
  22.   2 " Language: Golang text/template package
  23.   3 " Maintainer: moshee
  24.   4 " Latest Revision: 10 Dec 2011
  25.   5
  26.   6 if exists("b:current_syntax")
  27.   7   finish
  28.   8 endif
  29.   9
  30.  10 if !exists("main_syntax")
  31.  11   let main_syntax = "gotemplate"
  32.  12 endif
  33.  13
  34.  14 runtime! syntax/html.vim
  35.  15 unlet b:current_syntax
  36.  16
  37.  17 command! -nargs=+ HtmlHiLink hi def link <args>
  38.  18
  39.  19 syn keyword tmplKeywords  if else range with end contained
  40.  20 syn keyword tmplTodo      TODO NOTE contained
  41.  21
  42.  22 syn match   tmplField     /\..+/ contained
  43.  23 syn match   tmplPiped     /\|\s*.+/ contained
  44.  24 syn match   tmplVar       /\$/ contained
  45.  25
  46.  26 syn cluster tmplTop       add=tmplKeywords,tmplField,tmplPiped,tmplVar,tmplComment
  47.  27 syn cluster htmlContainer add=htmlHead,htmlTitle,htmlString,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6
  48.  28
  49.  29 syn region  tmplRegion    matchgroup=tmplDelimiter start="{{"  end="}}" contains=@tmplTop containedin=@htmlContainer
  50.  30 syn region  tmplComment   start="{{/\*" end="\*/}}" contains=tmplTodo
  51.  31
  52.  32 HtmlHiLink  tmplKeywords  Statement
  53.  33 HtmlHiLink  tmplField     Type
  54.  34 HtmlHiLink  tmplVar       Operator
  55.  35 HtmlHiLink  tmplComment   Comment
  56.  36 HtmlHiLink  tmplTodo      Todo
  57.  37 HtmlHiLink  tmplPiped     Function
  58.  38 hi          tmplDelimiter cterm=bold ctermfg=0 ctermbg=254
  59.  39
  60.  40
  61.  41 let b:current_syntax = "gotemplate"
  62.  42 delc HtmlHiLink
  63.  43
  64.  44 " vim: sw=4 ts=4;
Add Comment
Please, Sign In to add comment