Commits

danjac  committed 7f5d2cd

first commit

  • Participants

Comments (0)

Files changed (271)

File .vim/.netrwhist

+let g:netrw_dirhistmax  =10
+let g:netrw_dirhist_cnt =1
+let g:netrw_dirhist_1='/home/danjac/Downloads/pinax_test/lib/python2.6/site-packages/pinax/apps/blog'

File .vim/colors/ir_black.vim

+" ir_black color scheme
+" More at: http://blog.infinitered.com/entries/show/8
+
+
+" ********************************************************************************
+" Standard colors used in all ir_black themes:
+" Note, x:x:x are RGB values
+"
+"  normal: #f6f3e8
+" 
+"  string: #A8FF60  168:255:96                   
+"    string inner (punc, code, etc): #00A0A0  0:160:160
+"  number: #FF73FD  255:115:253                 
+"  comments: #7C7C7C  124:124:124
+"  keywords: #96CBFE  150:203:254             
+"  operators: white
+"  class: #FFFFB6  255:255:182
+"  method declaration name: #FFD2A7  255:210:167
+"  regular expression: #E9C062  233:192:98
+"    regexp alternate: #FF8000  255:128:0
+"    regexp alternate 2: #B18A3D  177:138:61
+"  variable: #C6C5FE  198:197:254
+"  
+" Misc colors:
+"  red color (used for whatever): #FF6C60   255:108:96 
+"     light red: #FFB6B0   255:182:176
+"
+"  brown: #E18964  good for special
+"
+"  lightpurpleish: #FFCCFF
+" 
+" Interface colors:
+"  background color: black
+"  cursor (where underscore is used): #FFA560  255:165:96
+"  cursor (where block is used): white
+"  visual selection: #1D1E2C  
+"  current line: #151515  21:21:21
+"  search selection: #07281C  7:40:28
+"  line number: #3D3D3D  61:61:61
+
+
+" ********************************************************************************
+" The following are the preferred 16 colors for your terminal
+"           Colors      Bright Colors
+" Black     #4E4E4E     #7C7C7C
+" Red       #FF6C60     #FFB6B0
+" Green     #A8FF60     #CEFFAB
+" Yellow    #FFFFB6     #FFFFCB
+" Blue      #96CBFE     #FFFFCB
+" Magenta   #FF73FD     #FF9CFE
+" Cyan      #C6C5FE     #DFDFFE
+" White     #EEEEEE     #FFFFFF
+
+
+" ********************************************************************************
+set background=dark
+hi clear
+
+if exists("syntax_on")
+  syntax reset
+endif
+
+let colors_name = "ir_black"
+
+
+"hi Example         guifg=NONE        guibg=NONE        gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+
+" General colors
+hi Normal           guifg=#f6f3e8     guibg=black       gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+hi NonText          guifg=#070707     guibg=black       gui=NONE      ctermfg=black       ctermbg=NONE        cterm=NONE
+
+hi Cursor           guifg=black       guibg=white       gui=NONE      ctermfg=black       ctermbg=white       cterm=reverse
+hi LineNr           guifg=#3D3D3D     guibg=black       gui=NONE      ctermfg=darkgray    ctermbg=NONE        cterm=NONE
+
+hi VertSplit        guifg=#202020     guibg=#202020     gui=NONE      ctermfg=darkgray    ctermbg=darkgray    cterm=NONE
+hi StatusLine       guifg=#CCCCCC     guibg=#202020     gui=italic    ctermfg=white       ctermbg=darkgray    cterm=NONE
+hi StatusLineNC     guifg=black       guibg=#202020     gui=NONE      ctermfg=blue        ctermbg=darkgray    cterm=NONE  
+
+hi Folded           guifg=#a0a8b0     guibg=#384048     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+hi Title            guifg=#f6f3e8     guibg=NONE        gui=bold      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+hi Visual           guifg=NONE        guibg=#262D51     gui=NONE      ctermfg=NONE        ctermbg=darkgray    cterm=NONE
+
+hi SpecialKey       guifg=#808080     guibg=#343434     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+
+hi WildMenu         guifg=green       guibg=yellow      gui=NONE      ctermfg=black       ctermbg=yellow      cterm=NONE
+hi PmenuSbar        guifg=black       guibg=white       gui=NONE      ctermfg=black       ctermbg=white       cterm=NONE
+"hi Ignore           guifg=gray        guibg=black       gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+
+hi Error            guifg=NONE        guibg=NONE        gui=undercurl ctermfg=white       ctermbg=red         cterm=NONE     guisp=#FF6C60 " undercurl color
+hi ErrorMsg         guifg=white       guibg=#FF6C60     gui=BOLD      ctermfg=white       ctermbg=red         cterm=NONE
+hi WarningMsg       guifg=white       guibg=#FF6C60     gui=BOLD      ctermfg=white       ctermbg=red         cterm=NONE
+
+" Message displayed in lower left, such as --INSERT--
+hi ModeMsg          guifg=black       guibg=#C6C5FE     gui=BOLD      ctermfg=black       ctermbg=cyan        cterm=BOLD
+
+if version >= 700 " Vim 7.x specific colors
+  hi CursorLine     guifg=NONE        guibg=#121212     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=BOLD
+  hi CursorColumn   guifg=NONE        guibg=#121212     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=BOLD
+  hi MatchParen     guifg=#f6f3e8     guibg=#857b6f     gui=BOLD      ctermfg=white       ctermbg=darkgray    cterm=NONE
+  hi Pmenu          guifg=#f6f3e8     guibg=#444444     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+  hi PmenuSel       guifg=#000000     guibg=#cae682     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
+  hi Search         guifg=NONE        guibg=NONE        gui=underline ctermfg=NONE        ctermbg=NONE        cterm=underline
+endif
+
+" Syntax highlighting
+hi Comment          guifg=#7C7C7C     guibg=NONE        gui=NONE      ctermfg=darkgray    ctermbg=NONE        cterm=NONE
+hi String           guifg=#A8FF60     guibg=NONE        gui=NONE      ctermfg=green       ctermbg=NONE        cterm=NONE
+hi Number           guifg=#FF73FD     guibg=NONE        gui=NONE      ctermfg=magenta     ctermbg=NONE        cterm=NONE
+
+hi Keyword          guifg=#96CBFE     guibg=NONE        gui=NONE      ctermfg=blue        ctermbg=NONE        cterm=NONE
+hi PreProc          guifg=#96CBFE     guibg=NONE        gui=NONE      ctermfg=blue        ctermbg=NONE        cterm=NONE
+hi Conditional      guifg=#6699CC     guibg=NONE        gui=NONE      ctermfg=blue        ctermbg=NONE        cterm=NONE  " if else end
+
+hi Todo             guifg=#8f8f8f     guibg=NONE        gui=NONE      ctermfg=red         ctermbg=NONE        cterm=NONE
+hi Constant         guifg=#99CC99     guibg=NONE        gui=NONE      ctermfg=cyan        ctermbg=NONE        cterm=NONE
+
+hi Identifier       guifg=#C6C5FE     guibg=NONE        gui=NONE      ctermfg=cyan        ctermbg=NONE        cterm=NONE
+hi Function         guifg=#FFD2A7     guibg=NONE        gui=NONE      ctermfg=brown       ctermbg=NONE        cterm=NONE
+hi Type             guifg=#FFFFB6     guibg=NONE        gui=NONE      ctermfg=yellow      ctermbg=NONE        cterm=NONE
+hi Statement        guifg=#6699CC     guibg=NONE        gui=NONE      ctermfg=lightblue   ctermbg=NONE        cterm=NONE
+
+hi Special          guifg=#E18964     guibg=NONE        gui=NONE      ctermfg=white       ctermbg=NONE        cterm=NONE
+hi Delimiter        guifg=#00A0A0     guibg=NONE        gui=NONE      ctermfg=cyan        ctermbg=NONE        cterm=NONE
+hi Operator         guifg=white       guibg=NONE        gui=NONE      ctermfg=white       ctermbg=NONE        cterm=NONE
+
+hi link Character       Constant
+hi link Boolean         Constant
+hi link Float           Number
+hi link Repeat          Statement
+hi link Label           Statement
+hi link Exception       Statement
+hi link Include         PreProc
+hi link Define          PreProc
+hi link Macro           PreProc
+hi link PreCondit       PreProc
+hi link StorageClass    Type
+hi link Structure       Type
+hi link Typedef         Type
+hi link Tag             Special
+hi link SpecialChar     Special
+hi link SpecialComment  Special
+hi link Debug           Special
+
+
+" Special for Ruby
+hi rubyRegexp                  guifg=#B18A3D      guibg=NONE      gui=NONE      ctermfg=brown          ctermbg=NONE      cterm=NONE
+hi rubyRegexpDelimiter         guifg=#FF8000      guibg=NONE      gui=NONE      ctermfg=brown          ctermbg=NONE      cterm=NONE
+hi rubyEscape                  guifg=white        guibg=NONE      gui=NONE      ctermfg=cyan           ctermbg=NONE      cterm=NONE
+hi rubyInterpolationDelimiter  guifg=#00A0A0      guibg=NONE      gui=NONE      ctermfg=blue           ctermbg=NONE      cterm=NONE
+hi rubyControl                 guifg=#6699CC      guibg=NONE      gui=NONE      ctermfg=blue           ctermbg=NONE      cterm=NONE  "and break, etc
+"hi rubyGlobalVariable          guifg=#FFCCFF      guibg=NONE      gui=NONE      ctermfg=lightblue      ctermbg=NONE      cterm=NONE  "yield
+hi rubyStringDelimiter         guifg=#336633      guibg=NONE      gui=NONE      ctermfg=lightgreen     ctermbg=NONE      cterm=NONE
+"rubyInclude
+"rubySharpBang
+"rubyAccess
+"rubyPredefinedVariable
+"rubyBoolean
+"rubyClassVariable
+"rubyBeginEnd
+"rubyRepeatModifier
+"hi link rubyArrayDelimiter    Special  " [ , , ]
+"rubyCurlyBlock  { , , }
+
+hi link rubyClass             Keyword 
+hi link rubyModule            Keyword 
+hi link rubyKeyword           Keyword 
+hi link rubyOperator          Operator
+hi link rubyIdentifier        Identifier
+hi link rubyInstanceVariable  Identifier
+hi link rubyGlobalVariable    Identifier
+hi link rubyClassVariable     Identifier
+hi link rubyConstant          Type  
+
+
+" Special for Java
+" hi link javaClassDecl    Type
+hi link javaScopeDecl         Identifier 
+hi link javaCommentTitle      javaDocSeeTag 
+hi link javaDocTags           javaDocSeeTag 
+hi link javaDocParam          javaDocSeeTag 
+hi link javaDocSeeTagParam    javaDocSeeTag 
+
+hi javaDocSeeTag              guifg=#CCCCCC     guibg=NONE        gui=NONE      ctermfg=darkgray    ctermbg=NONE        cterm=NONE
+hi javaDocSeeTag              guifg=#CCCCCC     guibg=NONE        gui=NONE      ctermfg=darkgray    ctermbg=NONE        cterm=NONE
+"hi javaClassDecl              guifg=#CCFFCC     guibg=NONE        gui=NONE      ctermfg=white       ctermbg=NONE        cterm=NONE
+
+
+" Special for XML
+hi link xmlTag          Keyword 
+hi link xmlTagName      Conditional 
+hi link xmlEndTag       Identifier 
+
+
+" Special for HTML
+hi link htmlTag         Keyword 
+hi link htmlTagName     Conditional 
+hi link htmlEndTag      Identifier 
+
+
+" Special for Javascript
+hi link javaScriptNumber      Number 
+
+
+" Special for Python
+"hi  link pythonEscape         Keyword      
+
+
+" Special for CSharp
+hi  link csXmlTag             Keyword      
+
+
+" Special for PHP

File .vim/colors/wombat.vim

+" Maintainer:	Lars H. Nielsen (dengmao@gmail.com)
+" Last Change:	January 22 2007
+
+set background=dark
+
+hi clear
+
+if exists("syntax_on")
+  syntax reset
+endif
+
+let colors_name = "wombat"
+
+
+" Vim >= 7.0 specific colors
+if version >= 700
+  hi CursorLine guibg=#2d2d2d
+  hi CursorColumn guibg=#2d2d2d
+  hi MatchParen guifg=#f6f3e8 guibg=#857b6f gui=bold
+  hi Pmenu 		guifg=#f6f3e8 guibg=#444444
+  hi PmenuSel 	guifg=#000000 guibg=#cae682
+endif
+
+" General colors
+hi Cursor 		guifg=NONE    guibg=#656565 gui=none
+hi Normal 		guifg=#f6f3e8 guibg=#242424 gui=none
+hi NonText 		guifg=#808080 guibg=#303030 gui=none
+hi LineNr 		guifg=#857b6f guibg=#000000 gui=none
+hi StatusLine 	guifg=#f6f3e8 guibg=#444444 gui=italic
+hi StatusLineNC guifg=#857b6f guibg=#444444 gui=none
+hi VertSplit 	guifg=#444444 guibg=#444444 gui=none
+hi Folded 		guibg=#384048 guifg=#a0a8b0 gui=none
+hi Title		guifg=#f6f3e8 guibg=NONE	gui=bold
+hi Visual		guifg=#f6f3e8 guibg=#444444 gui=none
+hi SpecialKey	guifg=#808080 guibg=#343434 gui=none
+
+" Syntax highlighting
+hi Comment 		guifg=#99968b gui=italic
+hi Todo 		guifg=#8f8f8f gui=italic
+hi Constant 	guifg=#e5786d gui=none
+hi String 		guifg=#95e454 gui=italic
+hi Identifier 	guifg=#cae682 gui=none
+hi Function 	guifg=#cae682 gui=none
+hi Type 		guifg=#cae682 gui=none
+hi Statement 	guifg=#8ac6f2 gui=none
+hi Keyword		guifg=#8ac6f2 gui=none
+hi PreProc 		guifg=#e5786d gui=none
+hi Number		guifg=#e5786d gui=none
+hi Special		guifg=#e7f6da gui=none
+
+

File .vim/compiler/pylint.vim

+" Vim compiler file for Python
+" Compiler:     Style checking tool for Python
+" Maintainer:   Oleksandr Tymoshenko <gonzo@univ.kiev.ua>
+" Last Change:  2009 Apr 19 
+" Version:      0.5 
+" Contributors:
+"     Artur Wroblewski
+"     Menno
+"
+" Installation:
+"   Drop pylint.vim in ~/.vim/compiler directory. Ensure that your PATH
+"   environment variable includes the path to 'pylint' executable.
+"
+"   Add the following line to the autocmd section of .vimrc
+"
+"      autocmd FileType python compiler pylint
+"
+" Usage:
+"   Pylint is called after a buffer with Python code is saved. QuickFix
+"   window is opened to show errors, warnings and hints provided by Pylint.
+"   Code rate calculated by Pylint is displayed at the bottom of the
+"   window.
+"
+"   Above is realized with :Pylint command. To disable calling Pylint every
+"   time a buffer is saved put into .vimrc file
+"
+"       let g:pylint_onwrite = 0
+"
+"   Displaying code rate calculated by Pylint can be avoided by setting
+"
+"       let g:pylint_show_rate = 0
+"
+"   Openning of QuickFix window can be disabled with
+"
+"       let g:pylint_cwindow = 0
+"
+"   Of course, standard :make command can be used as in case of every
+"   other compiler.
+"
+
+
+if exists('current_compiler')
+  finish
+endif
+let current_compiler = 'pylint'
+
+if !exists('g:pylint_onwrite')
+    let g:pylint_onwrite = 1
+endif
+
+if !exists('g:pylint_show_rate')
+    let g:pylint_show_rate = 1
+endif
+
+if !exists('g:pylint_cwindow')
+    let g:pylint_cwindow = 1
+endif
+
+if exists(':Pylint') != 2
+    command Pylint :call Pylint(0)
+endif
+
+if exists(":CompilerSet") != 2          " older Vim always used :setlocal
+  command -nargs=* CompilerSet setlocal <args>
+endif
+
+" We should echo filename because pylint truncates .py
+" If someone know better way - let me know :) 
+CompilerSet makeprg=(echo\ '[%]';\ pylint\ -r\ y\ %)
+
+" We could omit end of file-entry, there is only one file
+" %+I... - include code rating information
+" %-G... - remove all remaining report lines from quickfix buffer
+CompilerSet efm=%+P[%f],%t:\ %#%l:%m,%Z,%+IYour\ code%m,%Z,%-G%.%#
+
+if g:pylint_onwrite
+    augroup python
+        au!
+        au BufWritePost * call Pylint(1)
+    augroup end
+endif
+
+function! Pylint(writing)
+    if !a:writing && &modified
+        " Save before running
+        write
+    endif	
+
+    if has('win32') || has('win16') || has('win95') || has('win64')
+        setlocal sp=>%s
+    else
+        setlocal sp=>%s\ 2>&1
+    endif
+
+    " If check is executed by buffer write - do not jump to first error
+    if !a:writing
+        silent make
+    else
+        silent make!
+    endif
+
+    if g:pylint_cwindow
+        cwindow
+    endif
+
+    call PylintEvaluation()
+
+    if g:pylint_show_rate
+        echon 'code rate: ' b:pylint_rate ', prev: ' b:pylint_prev_rate
+    endif
+endfunction
+
+function! PylintEvaluation()
+    let l:list = getqflist()
+    let b:pylint_rate = '0.00'
+    let b:pylint_prev_rate = '0.00'
+    for l:item in l:list
+        if l:item.type == 'I' && l:item.text =~ 'Your code has been rated'
+            let l:re_rate = '\(-\?[0-9]\{1,2\}\.[0-9]\{2\}\)/'
+            let b:pylint_rate = substitute(l:item.text, '.*rated at '.l:re_rate.'.*', '\1', 'g')
+            " Only if there is information about previous run
+            if l:item.text =~ 'previous run: '
+                let b:pylint_prev_rate = substitute(l:item.text, '.*previous run: '.l:re_rate.'.*', '\1', 'g')
+            endif    
+        endif
+    endfor
+endfunction

File .vim/ftdetect/scala.vim

+"        $URL$
+   
+au BufRead,BufNewFile *.scala set filetype=scala

File .vim/ftplugin/html/zencoding.vim

+"=============================================================================
+" File: zencoding.vim
+" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
+" Last Change: 23-Apr-2010.
+" Version: 0.36
+" WebPage: http://github.com/mattn/zencoding-vim
+" Description: vim plugins for HTML and CSS hi-speed coding.
+" SeeAlso: http://code.google.com/p/zen-coding/
+" Usage:
+"
+"   This is vim script support expanding abbreviation like zen-coding.
+"   ref: http://code.google.com/p/zen-coding/
+"   
+"   Type abbreviation
+"      +-------------------------------------
+"      | html:5_
+"      +-------------------------------------
+"   "_" is a cursor position. and type "<c-y>," (Ctrl+y and Comma)
+"   NOTE: Don't worry about key map. you can change it easily.
+"      +-------------------------------------
+"      | <!DOCTYPE HTML>
+"      | <html lang="en">
+"      | <head>
+"      |     <title></title>
+"      |     <meta charset="UTF-8">
+"      | </head>
+"      | <body>
+"      |      _
+"      | </body>
+"      | </html>
+"      +-------------------------------------
+"   Type following
+"      +-------------------------------------
+"      | div#foo$*2>div.bar
+"      +-------------------------------------
+"   And type "<c-y>,"
+"      +-------------------------------------
+"      |<div id="foo1">
+"      |    <div class="bar">_</div>
+"      |</div>
+"      |<div id="foo2">
+"      |    <div class="bar"></div>
+"      |</div>
+"      +-------------------------------------
+"   
+" Tips:
+"   
+"   You can customize behavior of expanding with overriding config.
+"   This configuration will be marged at loading plugin. 
+"   
+"     let g:user_zen_settings = {
+"     \  'indentation' : '  ',
+"     \  'perl' : {
+"     \    'aliases' : {
+"     \      'req' : 'require '
+"     \    },
+"     \    'snippets' : {
+"     \      'use' : "use strict\nuse warnings\n\n",
+"     \      'warn' : "warn \"|\";",
+"     \    }
+"     \  }
+"     \}
+"
+"   You can set language attribute in html using 'zen_settings.lang'.
+"
+" GetLatestVimScripts: 2981 1 :AutoInstall: zencoding.vim
+" script type: plugin
+
+if !exists('g:zencoding_debug')
+  let g:zencoding_debug = 0
+endif
+
+if exists('g:use_zen_complete_tag') && g:use_zen_complete_tag
+  setlocal completefunc=ZenCompleteTag
+endif
+
+if !exists('g:user_zen_leader_key')
+  let g:user_zen_leader_key = '<c-y>'
+endif
+
+let s:target = expand('<sfile>:h') =~ '[\\/]plugin$' ? '' : '<buffer>'
+
+for s:item in [
+\ {'mode': 'i', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandAbbr', 'func': '<c-g>u<esc>:call <sid>zen_expandAbbr(0)<cr>a'},
+\ {'mode': 'i', 'var': 'user_zen_expandword_key', 'key': '.', 'plug': 'ZenCodingExpandWord', 'func': '<c-g>u<esc>:call <sid>zen_expandAbbr(1)<cr>a'},
+\ {'mode': 'v', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandVisual', 'func': ':call <sid>zen_expandAbbr(2)<cr>'},
+\ {'mode': 'n', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandNormal', 'func': ':call <sid>zen_expandAbbr(3)<cr>'},
+\ {'mode': 'i', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInwardInsert', 'func': '<esc>:call <sid>zen_balanceTag(1)<cr>a'},
+\ {'mode': 'n', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInwardNormal', 'func': ':call <sid>zen_balanceTag(1)<cr>'},
+\ {'mode': 'v', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInwardVisual', 'func': ':call <sid>zen_balanceTag(2)<cr>'},
+\ {'mode': 'i', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutwardInsert', 'func': '<esc>:call <sid>zen_balanceTag(-1)<cr>a'},
+\ {'mode': 'n', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutwardNormal', 'func': ':call <sid>zen_balanceTag(-1)<cr>'},
+\ {'mode': 'v', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutwardVisual', 'func': ':call <sid>zen_balanceTag(-2)<cr>'},
+\ {'mode': 'i', 'var': 'user_zen_next_key', 'key': 'n', 'plug': 'ZenCodingNext', 'func': '<esc>:call <sid>zen_moveNextPrev(0)<cr>'},
+\ {'mode': 'n', 'var': 'user_zen_next_key', 'key': 'n', 'plug': 'ZenCodingNext', 'func': ':call <sid>zen_moveNextPrev(0)<cr>'},
+\ {'mode': 'i', 'var': 'user_zen_prev_key', 'key': 'N', 'plug': 'ZenCodingPrev', 'func': '<esc>:call <sid>zen_moveNextPrev(1)<cr>'},
+\ {'mode': 'n', 'var': 'user_zen_prev_key', 'key': 'N', 'plug': 'ZenCodingPrev', 'func': ':call <sid>zen_moveNextPrev(1)<cr>'},
+\ {'mode': 'i', 'var': 'user_zen_imagesize_key', 'key': 'i', 'plug': 'ZenCodingImageSize', 'func': '<esc>:call <sid>zen_imageSize()<cr>a'},
+\ {'mode': 'n', 'var': 'user_zen_imagesize_key', 'key': 'i', 'plug': 'ZenCodingImageSize', 'func': ':call <sid>zen_imageSize()<cr>'},
+\ {'mode': 'i', 'var': 'user_zen_togglecomment_key', 'key': '/', 'plug': 'ZenCodingToggleComment', 'func': '<esc>:call <sid>zen_toggleComment()<cr>a'},
+\ {'mode': 'n', 'var': 'user_zen_togglecomment_key', 'key': '/', 'plug': 'ZenCodingToggleComment', 'func': ':call <sid>zen_toggleComment()<cr>'},
+\ {'mode': 'i', 'var': 'user_zen_splitjointag_key', 'key': 'j', 'plug': 'ZenCodingSplitJoinTagInsert', 'func': '<esc>:call <sid>zen_splitJoinTag()<cr>a'},
+\ {'mode': 'n', 'var': 'user_zen_splitjointag_key', 'key': 'j', 'plug': 'ZenCodingSplitJoinTagNormal', 'func': ':call <sid>zen_splitJoinTag()<cr>'},
+\ {'mode': 'i', 'var': 'user_zen_removetag_key', 'key': 'k', 'plug': 'ZenCodingRemoveTag', 'func': '<esc>:call <sid>zen_removeTag()<cr>a'},
+\ {'mode': 'n', 'var': 'user_zen_removetag_key', 'key': 'k', 'plug': 'ZenCodingRemoveTag', 'func': ':call <sid>zen_removeTag()<cr>'},
+\ {'mode': 'i', 'var': 'user_zen_anchorizeurl_key', 'key': 'a', 'plug': 'ZenCodingAnchorizeURL', 'func': '<esc>:call <sid>zen_anchorizeURL(0)<cr>a'},
+\ {'mode': 'n', 'var': 'user_zen_anchorizeurl_key', 'key': 'a', 'plug': 'ZenCodingAnchorizeURL', 'func': ':call <sid>zen_anchorizeURL(0)<cr>'},
+\ {'mode': 'i', 'var': 'user_zen_anchorizesummary_key', 'key': 'A', 'plug': 'ZenCodingAnchorizeSummary', 'func': '<esc>:call <sid>zen_anchorizeURL(1)<cr>a'},
+\ {'mode': 'n', 'var': 'user_zen_anchorizesummary_key', 'key': 'A', 'plug': 'ZenCodingAnchorizeSummary', 'func': ':call <sid>zen_anchorizeURL(1)<cr>'},
+\]
+   
+  if !hasmapto('<plug>'.s:item.plug, s:item.mode)
+    exe s:item.mode . 'noremap <plug>' . s:item.plug . ' ' . s:item.func
+  endif
+  if !exists('g:' . s:item.var)
+    exe 'let g:' . s:item.var . " = '" . g:user_zen_leader_key . s:item.key . "'"
+  endif
+  if !hasmapto(eval('g:' . s:item.var), s:item.mode)
+    exe s:item.mode . 'map ' . s:target . ' ' . eval('g:' . s:item.var) . ' <plug>' . s:item.plug
+  endif
+endfor
+unlet s:target
+unlet s:item
+
+if exists('s:zen_settings') && g:zencoding_debug == 0
+  finish
+endif
+
+unlet! s:zen_settings
+let s:zen_settings = {
+\    'indentation': "\t",
+\    'lang': "en",
+\    'css': {
+\        'snippets': {
+\            '@i': '@import url(|);',
+\            '@m': "@media print {\n\t|\n}",
+\            '@f': "@font-face {\n\tfont-family:|;\n\tsrc:url(|);\n}",
+\            '!': '!important',
+\            'pos': 'position:|;',
+\            'pos:s': 'position:static;',
+\            'pos:a': 'position:absolute;',
+\            'pos:r': 'position:relative;',
+\            'pos:f': 'position:fixed;',
+\            't': 'top:|;',
+\            't:a': 'top:auto;',
+\            'r': 'right:|;',
+\            'r:a': 'right:auto;',
+\            'b': 'bottom:|;',
+\            'b:a': 'bottom:auto;',
+\            'l': 'left:|;',
+\            'l:a': 'left:auto;',
+\            'z': 'z-index:|;',
+\            'z:a': 'z-index:auto;',
+\            'fl': 'float:|;',
+\            'fl:n': 'float:none;',
+\            'fl:l': 'float:left;',
+\            'fl:r': 'float:right;',
+\            'cl': 'clear:|;',
+\            'cl:n': 'clear:none;',
+\            'cl:l': 'clear:left;',
+\            'cl:r': 'clear:right;',
+\            'cl:b': 'clear:both;',
+\            'd': 'display:|;',
+\            'd:n': 'display:none;',
+\            'd:b': 'display:block;',
+\            'd:ib': 'display:inline;',
+\            'd:li': 'display:list-item;',
+\            'd:ri': 'display:run-in;',
+\            'd:cp': 'display:compact;',
+\            'd:tb': 'display:table;',
+\            'd:itb': 'display:inline-table;',
+\            'd:tbcp': 'display:table-caption;',
+\            'd:tbcl': 'display:table-column;',
+\            'd:tbclg': 'display:table-column-group;',
+\            'd:tbhg': 'display:table-header-group;',
+\            'd:tbfg': 'display:table-footer-group;',
+\            'd:tbr': 'display:table-row;',
+\            'd:tbrg': 'display:table-row-group;',
+\            'd:tbc': 'display:table-cell;',
+\            'd:rb': 'display:ruby;',
+\            'd:rbb': 'display:ruby-base;',
+\            'd:rbbg': 'display:ruby-base-group;',
+\            'd:rbt': 'display:ruby-text;',
+\            'd:rbtg': 'display:ruby-text-group;',
+\            'v': 'visibility:|;',
+\            'v:v': 'visibility:visible;',
+\            'v:h': 'visibility:hidden;',
+\            'v:c': 'visibility:collapse;',
+\            'ov': 'overflow:|;',
+\            'ov:v': 'overflow:visible;',
+\            'ov:h': 'overflow:hidden;',
+\            'ov:s': 'overflow:scroll;',
+\            'ov:a': 'overflow:auto;',
+\            'ovx': 'overflow-x:|;',
+\            'ovx:v': 'overflow-x:visible;',
+\            'ovx:h': 'overflow-x:hidden;',
+\            'ovx:s': 'overflow-x:scroll;',
+\            'ovx:a': 'overflow-x:auto;',
+\            'ovy': 'overflow-y:|;',
+\            'ovy:v': 'overflow-y:visible;',
+\            'ovy:h': 'overflow-y:hidden;',
+\            'ovy:s': 'overflow-y:scroll;',
+\            'ovy:a': 'overflow-y:auto;',
+\            'ovs': 'overflow-style:|;',
+\            'ovs:a': 'overflow-style:auto;',
+\            'ovs:s': 'overflow-style:scrollbar;',
+\            'ovs:p': 'overflow-style:panner;',
+\            'ovs:m': 'overflow-style:move;',
+\            'ovs:mq': 'overflow-style:marquee;',
+\            'zoo': 'zoom:1;',
+\            'cp': 'clip:|;',
+\            'cp:a': 'clip:auto;',
+\            'cp:r': 'clip:rect(|);',
+\            'bxz': 'box-sizing:|;',
+\            'bxz:cb': 'box-sizing:content-box;',
+\            'bxz:bb': 'box-sizing:border-box;',
+\            'bxsh': 'box-shadow:|;',
+\            'bxsh:n': 'box-shadow:none;',
+\            'bxsh:w': '-webkit-box-shadow:0 0 0 #000;',
+\            'bxsh:m': '-moz-box-shadow:0 0 0 0 #000;',
+\            'm': 'margin:|;',
+\            'm:a': 'margin:auto;',
+\            'm:0': 'margin:0;',
+\            'm:2': 'margin:0 0;',
+\            'm:3': 'margin:0 0 0;',
+\            'm:4': 'margin:0 0 0 0;',
+\            'mt': 'margin-top:|;',
+\            'mt:a': 'margin-top:auto;',
+\            'mr': 'margin-right:|;',
+\            'mr:a': 'margin-right:auto;',
+\            'mb': 'margin-bottom:|;',
+\            'mb:a': 'margin-bottom:auto;',
+\            'ml': 'margin-left:|;',
+\            'ml:a': 'margin-left:auto;',
+\            'p': 'padding:|;',
+\            'p:0': 'padding:0;',
+\            'p:2': 'padding:0 0;',
+\            'p:3': 'padding:0 0 0;',
+\            'p:4': 'padding:0 0 0 0;',
+\            'pt': 'padding-top:|;',
+\            'pr': 'padding-right:|;',
+\            'pb': 'padding-bottom:|;',
+\            'pl': 'padding-left:|;',
+\            'w': 'width:|;',
+\            'w:a': 'width:auto;',
+\            'h': 'height:|;',
+\            'h:a': 'height:auto;',
+\            'maw': 'max-width:|;',
+\            'maw:n': 'max-width:none;',
+\            'mah': 'max-height:|;',
+\            'mah:n': 'max-height:none;',
+\            'miw': 'min-width:|;',
+\            'mih': 'min-height:|;',
+\            'o': 'outline:|;',
+\            'o:n': 'outline:none;',
+\            'oo': 'outline-offset:|;',
+\            'ow': 'outline-width:|;',
+\            'os': 'outline-style:|;',
+\            'oc': 'outline-color:#000;',
+\            'oc:i': 'outline-color:invert;',
+\            'bd': 'border:|;',
+\            'bd+': 'border:1px solid #000;',
+\            'bd:n': 'border:none;',
+\            'bdbk': 'border-break:|;',
+\            'bdbk:c': 'border-break:close;',
+\            'bdcl': 'border-collapse:|;',
+\            'bdcl:c': 'border-collapse:collapse;',
+\            'bdcl:s': 'border-collapse:separate;',
+\            'bdc': 'border-color:#000;',
+\            'bdi': 'border-image:url(|);',
+\            'bdi:n': 'border-image:none;',
+\            'bdi:w': '-webkit-border-image:url(|) 0 0 0 0 stretch stretch;',
+\            'bdi:m': '-moz-border-image:url(|) 0 0 0 0 stretch stretch;',
+\            'bdti': 'border-top-image:url(|);',
+\            'bdti:n': 'border-top-image:none;',
+\            'bdri': 'border-right-image:url(|);',
+\            'bdri:n': 'border-right-image:none;',
+\            'bdbi': 'border-bottom-image:url(|);',
+\            'bdbi:n': 'border-bottom-image:none;',
+\            'bdli': 'border-left-image:url(|);',
+\            'bdli:n': 'border-left-image:none;',
+\            'bdci': 'border-corner-image:url(|);',
+\            'bdci:n': 'border-corner-image:none;',
+\            'bdci:c': 'border-corner-image:continue;',
+\            'bdtli': 'border-top-left-image:url(|);',
+\            'bdtli:n': 'border-top-left-image:none;',
+\            'bdtli:c': 'border-top-left-image:continue;',
+\            'bdtri': 'border-top-right-image:url(|);',
+\            'bdtri:n': 'border-top-right-image:none;',
+\            'bdtri:c': 'border-top-right-image:continue;',
+\            'bdbri': 'border-bottom-right-image:url(|);',
+\            'bdbri:n': 'border-bottom-right-image:none;',
+\            'bdbri:c': 'border-bottom-right-image:continue;',
+\            'bdbli': 'border-bottom-left-image:url(|);',
+\            'bdbli:n': 'border-bottom-left-image:none;',
+\            'bdbli:c': 'border-bottom-left-image:continue;',
+\            'bdf': 'border-fit:|;',
+\            'bdf:c': 'border-fit:clip;',
+\            'bdf:r': 'border-fit:repeat;',
+\            'bdf:sc': 'border-fit:scale;',
+\            'bdf:st': 'border-fit:stretch;',
+\            'bdf:ow': 'border-fit:overwrite;',
+\            'bdf:of': 'border-fit:overflow;',
+\            'bdf:sp': 'border-fit:space;',
+\            'bdl': 'border-left:|;',
+\            'bdl:a': 'border-length:auto;',
+\            'bdsp': 'border-spacing:|;',
+\            'bds': 'border-style:|;',
+\            'bds:n': 'border-style:none;',
+\            'bds:h': 'border-style:hidden;',
+\            'bds:dt': 'border-style:dotted;',
+\            'bds:ds': 'border-style:dashed;',
+\            'bds:s': 'border-style:solid;',
+\            'bds:db': 'border-style:double;',
+\            'bds:dtds': 'border-style:dot-dash;',
+\            'bds:dtdtds': 'border-style:dot-dot-dash;',
+\            'bds:w': 'border-style:wave;',
+\            'bds:g': 'border-style:groove;',
+\            'bds:r': 'border-style:ridge;',
+\            'bds:i': 'border-style:inset;',
+\            'bds:o': 'border-style:outset;',
+\            'bdw': 'border-width:|;',
+\            'bdt': 'border-top:|;',
+\            'bdt+': 'border-top:1px solid #000;',
+\            'bdt:n': 'border-top:none;',
+\            'bdtw': 'border-top-width:|;',
+\            'bdts': 'border-top-style:|;',
+\            'bdts:n': 'border-top-style:none;',
+\            'bdtc': 'border-top-color:#000;',
+\            'bdr': 'border-right:|;',
+\            'bdr+': 'border-right:1px solid #000;',
+\            'bdr:n': 'border-right:none;',
+\            'bdrw': 'border-right-width:|;',
+\            'bdrs': 'border-right-style:|;',
+\            'bdrs:n': 'border-right-style:none;',
+\            'bdrc': 'border-right-color:#000;',
+\            'bdb': 'border-bottom:|;',
+\            'bdb+': 'border-bottom:1px solid #000;',
+\            'bdb:n': 'border-bottom:none;',
+\            'bdbw': 'border-bottom-width:|;',
+\            'bdbs': 'border-bottom-style:|;',
+\            'bdbs:n': 'border-bottom-style:none;',
+\            'bdbc': 'border-bottom-color:#000;',
+\            'bdln': 'border-length:|;',
+\            'bdl+': 'border-left:1px solid #000;',
+\            'bdl:n': 'border-left:none;',
+\            'bdlw': 'border-left-width:|;',
+\            'bdls': 'border-left-style:|;',
+\            'bdls:n': 'border-left-style:none;',
+\            'bdlc': 'border-left-color:#000;',
+\            'bdrus': 'border-radius:|;',
+\            'bdtrrs': 'border-top-right-radius:|;',
+\            'bdtlrs': 'border-top-left-radius:|;',
+\            'bdbrrs': 'border-bottom-right-radius:|;',
+\            'bdblrs': 'border-bottom-left-radius:|;',
+\            'bg': 'background:|;',
+\            'bg+': 'background:#FFF url(|) 0 0 no-repeat;',
+\            'bg:n': 'background:none;',
+\            'bg:ie': 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=''|x.png'');',
+\            'bgc': 'background-color:#FFF;',
+\            'bgi': 'background-image:url(|);',
+\            'bgi:n': 'background-image:none;',
+\            'bgr': 'background-repeat:|;',
+\            'bgr:n': 'background-repeat:no-repeat;',
+\            'bgr:x': 'background-repeat:repeat-x;',
+\            'bgr:y': 'background-repeat:repeat-y;',
+\            'bga': 'background-attachment:|;',
+\            'bga:f': 'background-attachment:fixed;',
+\            'bga:s': 'background-attachment:scroll;',
+\            'bgp': 'background-position:0 0;',
+\            'bgpx': 'background-position-x:|;',
+\            'bgpy': 'background-position-y:|;',
+\            'bgbk': 'background-break:|;',
+\            'bgbk:bb': 'background-break:bounding-box;',
+\            'bgbk:eb': 'background-break:each-box;',
+\            'bgbk:c': 'background-break:continuous;',
+\            'bgcp': 'background-clip:|;',
+\            'bgcp:bb': 'background-clip:border-box;',
+\            'bgcp:pb': 'background-clip:padding-box;',
+\            'bgcp:cb': 'background-clip:content-box;',
+\            'bgcp:nc': 'background-clip:no-clip;',
+\            'bgo': 'background-origin:|;',
+\            'bgo:pb': 'background-origin:padding-box;',
+\            'bgo:bb': 'background-origin:border-box;',
+\            'bgo:cb': 'background-origin:content-box;',
+\            'bgz': 'background-size:|;',
+\            'bgz:a': 'background-size:auto;',
+\            'bgz:ct': 'background-size:contain;',
+\            'bgz:cv': 'background-size:cover;',
+\            'c': 'color:#000;',
+\            'tbl': 'table-layout:|;',
+\            'tbl:a': 'table-layout:auto;',
+\            'tbl:f': 'table-layout:fixed;',
+\            'cps': 'caption-side:|;',
+\            'cps:t': 'caption-side:top;',
+\            'cps:b': 'caption-side:bottom;',
+\            'ec': 'empty-cells:|;',
+\            'ec:s': 'empty-cells:show;',
+\            'ec:h': 'empty-cells:hide;',
+\            'lis': 'list-style:|;',
+\            'lis:n': 'list-style:none;',
+\            'lisp': 'list-style-position:|;',
+\            'lisp:i': 'list-style-position:inside;',
+\            'lisp:o': 'list-style-position:outside;',
+\            'list': 'list-style-type:|;',
+\            'list:n': 'list-style-type:none;',
+\            'list:d': 'list-style-type:disc;',
+\            'list:c': 'list-style-type:circle;',
+\            'list:s': 'list-style-type:square;',
+\            'list:dc': 'list-style-type:decimal;',
+\            'list:dclz': 'list-style-type:decimal-leading-zero;',
+\            'list:lr': 'list-style-type:lower-roman;',
+\            'list:ur': 'list-style-type:upper-roman;',
+\            'lisi': 'list-style-image:|;',
+\            'lisi:n': 'list-style-image:none;',
+\            'q': 'quotes:|;',
+\            'q:n': 'quotes:none;',
+\            'q:ru': 'quotes:''\00AB'' ''\00BB'' ''\201E'' ''\201C'';',
+\            'q:en': 'quotes:''\201C'' ''\201D'' ''\2018'' ''\2019'';',
+\            'ct': 'content:|;',
+\            'ct:n': 'content:normal;',
+\            'ct:oq': 'content:open-quote;',
+\            'ct:noq': 'content:no-open-quote;',
+\            'ct:cq': 'content:close-quote;',
+\            'ct:ncq': 'content:no-close-quote;',
+\            'ct:a': 'content:attr(|);',
+\            'ct:c': 'content:counter(|);',
+\            'ct:cs': 'content:counters(|);',
+\            'coi': 'counter-increment:|;',
+\            'cor': 'counter-reset:|;',
+\            'va': 'vertical-align:|;',
+\            'va:sup': 'vertical-align:super;',
+\            'va:t': 'vertical-align:top;',
+\            'va:tt': 'vertical-align:text-top;',
+\            'va:m': 'vertical-align:middle;',
+\            'va:bl': 'vertical-align:baseline;',
+\            'va:b': 'vertical-align:bottom;',
+\            'va:tb': 'vertical-align:text-bottom;',
+\            'va:sub': 'vertical-align:sub;',
+\            'ta': 'text-align:|;',
+\            'ta:l': 'text-align:left;',
+\            'ta:c': 'text-align:center;',
+\            'ta:r': 'text-align:right;',
+\            'tal': 'text-align-last:|;',
+\            'tal:a': 'text-align-last:auto;',
+\            'tal:l': 'text-align-last:left;',
+\            'tal:c': 'text-align-last:center;',
+\            'tal:r': 'text-align-last:right;',
+\            'td': 'text-decoration:|;',
+\            'td:n': 'text-decoration:none;',
+\            'td:u': 'text-decoration:underline;',
+\            'td:o': 'text-decoration:overline;',
+\            'td:l': 'text-decoration:line-through;',
+\            'te': 'text-emphasis:|;',
+\            'te:n': 'text-emphasis:none;',
+\            'te:ac': 'text-emphasis:accent;',
+\            'te:dt': 'text-emphasis:dot;',
+\            'te:c': 'text-emphasis:circle;',
+\            'te:ds': 'text-emphasis:disc;',
+\            'te:b': 'text-emphasis:before;',
+\            'te:a': 'text-emphasis:after;',
+\            'th': 'text-height:|;',
+\            'th:a': 'text-height:auto;',
+\            'th:f': 'text-height:font-size;',
+\            'th:t': 'text-height:text-size;',
+\            'th:m': 'text-height:max-size;',
+\            'ti': 'text-indent:|;',
+\            'ti:-': 'text-indent:-9999px;',
+\            'tj': 'text-justify:|;',
+\            'tj:a': 'text-justify:auto;',
+\            'tj:iw': 'text-justify:inter-word;',
+\            'tj:ii': 'text-justify:inter-ideograph;',
+\            'tj:ic': 'text-justify:inter-cluster;',
+\            'tj:d': 'text-justify:distribute;',
+\            'tj:k': 'text-justify:kashida;',
+\            'tj:t': 'text-justify:tibetan;',
+\            'to': 'text-outline:|;',
+\            'to+': 'text-outline:0 0 #000;',
+\            'to:n': 'text-outline:none;',
+\            'tr': 'text-replace:|;',
+\            'tr:n': 'text-replace:none;',
+\            'tt': 'text-transform:|;',
+\            'tt:n': 'text-transform:none;',
+\            'tt:c': 'text-transform:capitalize;',
+\            'tt:u': 'text-transform:uppercase;',
+\            'tt:l': 'text-transform:lowercase;',
+\            'tw': 'text-wrap:|;',
+\            'tw:n': 'text-wrap:normal;',
+\            'tw:no': 'text-wrap:none;',
+\            'tw:u': 'text-wrap:unrestricted;',
+\            'tw:s': 'text-wrap:suppress;',
+\            'tsh': 'text-shadow:|;',
+\            'tsh+': 'text-shadow:0 0 0 #000;',
+\            'tsh:n': 'text-shadow:none;',
+\            'lh': 'line-height:|;',
+\            'whs': 'white-space:|;',
+\            'whs:n': 'white-space:normal;',
+\            'whs:p': 'white-space:pre;',
+\            'whs:nw': 'white-space:nowrap;',
+\            'whs:pw': 'white-space:pre-wrap;',
+\            'whs:pl': 'white-space:pre-line;',
+\            'whsc': 'white-space-collapse:|;',
+\            'whsc:n': 'white-space-collapse:normal;',
+\            'whsc:k': 'white-space-collapse:keep-all;',
+\            'whsc:l': 'white-space-collapse:loose;',
+\            'whsc:bs': 'white-space-collapse:break-strict;',
+\            'whsc:ba': 'white-space-collapse:break-all;',
+\            'wob': 'word-break:|;',
+\            'wob:n': 'word-break:normal;',
+\            'wob:k': 'word-break:keep-all;',
+\            'wob:l': 'word-break:loose;',
+\            'wob:bs': 'word-break:break-strict;',
+\            'wob:ba': 'word-break:break-all;',
+\            'wos': 'word-spacing:|;',
+\            'wow': 'word-wrap:|;',
+\            'wow:nm': 'word-wrap:normal;',
+\            'wow:n': 'word-wrap:none;',
+\            'wow:u': 'word-wrap:unrestricted;',
+\            'wow:s': 'word-wrap:suppress;',
+\            'lts': 'letter-spacing:|;',
+\            'f': 'font:|;',
+\            'f+': 'font:1em Arial,sans-serif;',
+\            'fw': 'font-weight:|;',
+\            'fw:n': 'font-weight:normal;',
+\            'fw:b': 'font-weight:bold;',
+\            'fw:br': 'font-weight:bolder;',
+\            'fw:lr': 'font-weight:lighter;',
+\            'fs': 'font-style:|;',
+\            'fs:n': 'font-style:normal;',
+\            'fs:i': 'font-style:italic;',
+\            'fs:o': 'font-style:oblique;',
+\            'fv': 'font-variant:|;',
+\            'fv:n': 'font-variant:normal;',
+\            'fv:sc': 'font-variant:small-caps;',
+\            'fz': 'font-size:|;',
+\            'fza': 'font-size-adjust:|;',
+\            'fza:n': 'font-size-adjust:none;',
+\            'ff': 'font-family:|;',
+\            'ff:s': 'font-family:serif;',
+\            'ff:ss': 'font-family:sans-serif;',
+\            'ff:c': 'font-family:cursive;',
+\            'ff:f': 'font-family:fantasy;',
+\            'ff:m': 'font-family:monospace;',
+\            'fef': 'font-effect:|;',
+\            'fef:n': 'font-effect:none;',
+\            'fef:eg': 'font-effect:engrave;',
+\            'fef:eb': 'font-effect:emboss;',
+\            'fef:o': 'font-effect:outline;',
+\            'fem': 'font-emphasize:|;',
+\            'femp': 'font-emphasize-position:|;',
+\            'femp:b': 'font-emphasize-position:before;',
+\            'femp:a': 'font-emphasize-position:after;',
+\            'fems': 'font-emphasize-style:|;',
+\            'fems:n': 'font-emphasize-style:none;',
+\            'fems:ac': 'font-emphasize-style:accent;',
+\            'fems:dt': 'font-emphasize-style:dot;',
+\            'fems:c': 'font-emphasize-style:circle;',
+\            'fems:ds': 'font-emphasize-style:disc;',
+\            'fsm': 'font-smooth:|;',
+\            'fsm:a': 'font-smooth:auto;',
+\            'fsm:n': 'font-smooth:never;',
+\            'fsm:aw': 'font-smooth:always;',
+\            'fst': 'font-stretch:|;',
+\            'fst:n': 'font-stretch:normal;',
+\            'fst:uc': 'font-stretch:ultra-condensed;',
+\            'fst:ec': 'font-stretch:extra-condensed;',
+\            'fst:c': 'font-stretch:condensed;',
+\            'fst:sc': 'font-stretch:semi-condensed;',
+\            'fst:se': 'font-stretch:semi-expanded;',
+\            'fst:e': 'font-stretch:expanded;',
+\            'fst:ee': 'font-stretch:extra-expanded;',
+\            'fst:ue': 'font-stretch:ultra-expanded;',
+\            'op': 'opacity:|;',
+\            'op:ie': 'filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);',
+\            'op:ms': '-ms-filter:''progid:DXImageTransform.Microsoft.Alpha(Opacity=100)'';',
+\            'rz': 'resize:|;',
+\            'rz:n': 'resize:none;',
+\            'rz:b': 'resize:both;',
+\            'rz:h': 'resize:horizontal;',
+\            'rz:v': 'resize:vertical;',
+\            'cur': 'cursor:|;',
+\            'cur:a': 'cursor:auto;',
+\            'cur:d': 'cursor:default;',
+\            'cur:c': 'cursor:crosshair;',
+\            'cur:ha': 'cursor:hand;',
+\            'cur:he': 'cursor:help;',
+\            'cur:m': 'cursor:move;',
+\            'cur:p': 'cursor:pointer;',
+\            'cur:t': 'cursor:text;',
+\            'pgbb': 'page-break-before:|;',
+\            'pgbb:au': 'page-break-before:auto;',
+\            'pgbb:al': 'page-break-before:always;',
+\            'pgbb:l': 'page-break-before:left;',
+\            'pgbb:r': 'page-break-before:right;',
+\            'pgbi': 'page-break-inside:|;',
+\            'pgbi:au': 'page-break-inside:auto;',
+\            'pgbi:av': 'page-break-inside:avoid;',
+\            'pgba': 'page-break-after:|;',
+\            'pgba:au': 'page-break-after:auto;',
+\            'pgba:al': 'page-break-after:always;',
+\            'pgba:l': 'page-break-after:left;',
+\            'pgba:r': 'page-break-after:right;',
+\            'orp': 'orphans:|;',
+\            'wid': 'widows:|;'
+\        }
+\    },
+\    'html': {
+\        'snippets': {
+\            'cc:ie6': "<!--[if lte IE 6]>\n\t${child}|\n<![endif]-->",
+\            'cc:ie': "<!--[if IE]>\n\t${child}|\n<![endif]-->",
+\            'cc:noie': "<!--[if !IE]><!-->\n\t${child}|\n<!--<![endif]-->",
+\            'html:4t': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
+\                    ."<html lang=\"${lang}\">\n"
+\                    ."<head>\n"
+\                    ."    <meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">\n"
+\                    ."    <title></title>\n"
+\                    ."</head>\n"
+\                    ."<body>\n\t${child}|\n</body>\n"
+\                    ."</html>",
+\            'html:4s': "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n"
+\                    ."<html lang=\"${lang}\">\n"
+\                    ."<head>\n"
+\                    ."    <meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">\n"
+\                    ."    <title></title>\n"
+\                    ."</head>\n"
+\                    ."<body>\n\t${child}|\n</body>\n"
+\                    ."</html>",
+\            'html:xt': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
+\                    ."<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"${lang}\">\n"
+\                    ."<head>\n"
+\                    ."    <meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\" />\n"
+\                    ."    <title></title>\n"
+\                    ."</head>\n"
+\                    ."<body>\n\t${child}|\n</body>\n"
+\                    ."</html>",
+\            'html:xs': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
+\                    ."<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"${lang}\">\n"
+\                    ."<head>\n"
+\                    ."    <meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\" />\n"
+\                    ."    <title></title>\n"
+\                    ."</head>\n"
+\                    ."<body>\n\t${child}|\n</body>\n"
+\                    ."</html>",
+\            'html:xxs': "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
+\                    ."<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"${lang}\">\n"
+\                    ."<head>\n"
+\                    ."    <meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\" />\n"
+\                    ."    <title></title>\n"
+\                    ."</head>\n"
+\                    ."<body>\n\t${child}|\n</body>\n"
+\                    ."</html>",
+\            'html:5': "<!DOCTYPE HTML>\n"
+\                    ."<html lang=\"${lang}\">\n"
+\                    ."<head>\n"
+\                    ."    <meta charset=\"UTF-8\">\n"
+\                    ."    <title></title>\n"
+\                    ."</head>\n"
+\                    ."<body>\n\t${child}|\n</body>\n"
+\                    ."</html>"
+\        },
+\        'default_attributes': {
+\            'a': {'href': ''},
+\            'a:link': {'href': 'http://|'},
+\            'a:mail': {'href': 'mailto:|'},
+\            'abbr': {'title': ''},
+\            'acronym': {'title': ''},
+\            'base': {'href': ''},
+\            'bdo': {'dir': ''},
+\            'bdo:r': {'dir': 'rtl'},
+\            'bdo:l': {'dir': 'ltr'},
+\            'del': {'datetime': '${datetime}'},
+\            'ins': {'datetime': '${datetime}'},
+\            'link:css': [{'rel': 'stylesheet'}, {'type': 'text/css'}, {'href': '|style.css'}, {'media': 'all'}],
+\            'link:print': [{'rel': 'stylesheet'}, {'type': 'text/css'}, {'href': '|print.css'}, {'media': 'print'}],
+\            'link:favicon': [{'rel': 'shortcut icon'}, {'type': 'image/x-icon'}, {'href': '|favicon.ico'}],
+\            'link:touch': [{'rel': 'apple-touch-icon'}, {'href': '|favicon.png'}],
+\            'link:rss': [{'rel': 'alternate'}, {'type': 'application/rss+xml'}, {'title': 'RSS'}, {'href': '|rss.xml'}],
+\            'link:atom': [{'rel': 'alternate'}, {'type': 'application/atom+xml'}, {'title': 'Atom'}, {'href': 'atom.xml'}],
+\            'meta:utf': [{'http-equiv': 'Content-Type'}, {'content': 'text/html;charset=UTF-8'}],
+\            'meta:win': [{'http-equiv': 'Content-Type'}, {'content': 'text/html;charset=Win-1251'}],
+\            'meta:compat': [{'http-equiv': 'X-UA-Compatible'}, {'content': 'IE=7'}],
+\            'style': {'type': 'text/css'},
+\            'script': {'type': 'text/javascript'},
+\            'script:src': [{'type': 'text/javascript'}, {'src': ''}],
+\            'img': [{'src': ''}, {'alt': ''}],
+\            'iframe': [{'src': ''}, {'frameborder': '0'}],
+\            'embed': [{'src': ''}, {'type': ''}],
+\            'object': [{'data': ''}, {'type': ''}],
+\            'param': [{'name': ''}, {'value': ''}],
+\            'map': {'name': ''},
+\            'area': [{'shape': ''}, {'coords': ''}, {'href': ''}, {'alt': ''}],
+\            'area:d': [{'shape': 'default'}, {'href': ''}, {'alt': ''}],
+\            'area:c': [{'shape': 'circle'}, {'coords': ''}, {'href': ''}, {'alt': ''}],
+\            'area:r': [{'shape': 'rect'}, {'coords': ''}, {'href': ''}, {'alt': ''}],
+\            'area:p': [{'shape': 'poly'}, {'coords': ''}, {'href': ''}, {'alt': ''}],
+\            'link': [{'rel': 'stylesheet'}, {'href': ''}],
+\            'form': {'action': ''},
+\            'form:get': {'action': '', 'method': 'get'},
+\            'form:post': {'action': '', 'method': 'post'},
+\            'label': {'for': ''},
+\            'input': {'type': ''},
+\            'input:hidden': [{'type': 'hidden'}, {'name': ''}],
+\            'input:h': [{'type': 'hidden'}, {'name': ''}],
+\            'input:text': [{'type': 'text'}, {'name': ''}, {'id': ''}],
+\            'input:t': [{'type': 'text'}, {'name': ''}, {'id': ''}],
+\            'input:search': [{'type': 'search'}, {'name': ''}, {'id': ''}],
+\            'input:email': [{'type': 'email'}, {'name': ''}, {'id': ''}],
+\            'input:url': [{'type': 'url'}, {'name': ''}, {'id': ''}],
+\            'input:password': [{'type': 'password'}, {'name': ''}, {'id': ''}],
+\            'input:p': [{'type': 'password'}, {'name': ''}, {'id': ''}],
+\            'input:datetime': [{'type': 'datetime'}, {'name': ''}, {'id': ''}],
+\            'input:date': [{'type': 'date'}, {'name': ''}, {'id': ''}],
+\            'input:datetime-local': [{'type': 'datetime-local'}, {'name': ''}, {'id': ''}],
+\            'input:month': [{'type': 'month'}, {'name': ''}, {'id': ''}],
+\            'input:week': [{'type': 'week'}, {'name': ''}, {'id': ''}],
+\            'input:time': [{'type': 'time'}, {'name': ''}, {'id': ''}],
+\            'input:number': [{'type': 'number'}, {'name': ''}, {'id': ''}],
+\            'input:color': [{'type': 'color'}, {'name': ''}, {'id': ''}],
+\            'input:checkbox': [{'type': 'checkbox'}, {'name': ''}, {'id': ''}],
+\            'input:c': [{'type': 'checkbox'}, {'name': ''}, {'id': ''}],
+\            'input:radio': [{'type': 'radio'}, {'name': ''}, {'id': ''}],
+\            'input:r': [{'type': 'radio'}, {'name': ''}, {'id': ''}],
+\            'input:range': [{'type': 'range'}, {'name': ''}, {'id': ''}],
+\            'input:file': [{'type': 'file'}, {'name': ''}, {'id': ''}],
+\            'input:f': [{'type': 'file'}, {'name': ''}, {'id': ''}],
+\            'input:submit': [{'type': 'submit'}, {'value': ''}],
+\            'input:s': [{'type': 'submit'}, {'value': ''}],
+\            'input:image': [{'type': 'image'}, {'src': ''}, {'alt': ''}],
+\            'input:i': [{'type': 'image'}, {'src': ''}, {'alt': ''}],
+\            'input:reset': [{'type': 'reset'}, {'value': ''}],
+\            'input:button': [{'type': 'button'}, {'value': ''}],
+\            'input:b': [{'type': 'button'}, {'value': ''}],
+\            'select': [{'name': ''}, {'id': ''}],
+\            'option': {'value': ''},
+\            'textarea': [{'name': ''}, {'id': ''}, {'cols': '30'}, {'rows': '10'}],
+\            'menu:context': {'type': 'context'},
+\            'menu:c': {'type': 'context'},
+\            'menu:toolbar': {'type': 'toolbar'},
+\            'menu:t': {'type': 'toolbar'},
+\            'video': {'src': ''},
+\            'audio': {'src': ''},
+\            'html:xml': [{'xmlns': 'http://www.w3.org/1999/xhtml'}, {'xml:lang': 'ru'}]
+\        },
+\        'aliases': {
+\            'link:*': 'link',
+\            'meta:*': 'meta',
+\            'area:*': 'area',
+\            'bdo:*': 'bdo',
+\            'form:*': 'form',
+\            'input:*': 'input',
+\            'script:*': 'script',
+\            'html:*': 'html',
+\            'a:*': 'a',
+\            'menu:*': 'menu',
+\            'bq': 'blockquote',
+\            'acr': 'acronym',
+\            'fig': 'figure',
+\            'ifr': 'iframe',
+\            'emb': 'embed',
+\            'obj': 'object',
+\            'src': 'source',
+\            'cap': 'caption',
+\            'colg': 'colgroup',
+\            'fst': 'fieldset',
+\            'btn': 'button',
+\            'optg': 'optgroup',
+\            'opt': 'option',
+\            'tarea': 'textarea',
+\            'leg': 'legend',
+\            'sect': 'section',
+\            'art': 'article',
+\            'hdr': 'header',
+\            'ftr': 'footer',
+\            'adr': 'address',
+\            'dlg': 'dialog',
+\            'str': 'strong',
+\            'sty': 'style',
+\            'prog': 'progress',
+\            'fset': 'fieldset',
+\            'datag': 'datagrid',
+\            'datal': 'datalist',
+\            'kg': 'keygen',
+\            'out': 'output',
+\            'det': 'details',
+\            'cmd': 'command'
+\        },
+\        'expandos': {
+\            'ol': 'ol>li',
+\            'ul': 'ul>li',
+\            'dl': 'dl>dt+dd',
+\            'map': 'map>area',
+\            'table': 'table>tr>td',
+\            'colgroup': 'colgroup>col',
+\            'colg': 'colgroup>col',
+\            'tr': 'tr>td',
+\            'select': 'select>option',
+\            'optgroup': 'optgroup>option',
+\            'optg': 'optgroup>option'
+\        },
+\        'empty_elements': 'area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,keygen,command',
+\        'block_elements': 'address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,link,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul,h1,h2,h3,h4,h5,h6,style',
+\        'inline_elements': 'a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var',
+\    },
+\    'xsl': {
+\        'extends': 'html',
+\        'default_attributes': {
+\            'tmatch': [{'match': ''}, {'mode': ''}],
+\            'tname': [{'name': ''}],
+\            'xsl:when': {'test': ''},
+\            'var': [{'name': ''}, {'select': ''}],
+\            'vari': {'name': ''},
+\            'if': {'test': ''},
+\            'call': {'name': ''},
+\            'attr': {'name': ''},
+\            'wp': [{'name': ''}, {'select': ''}],
+\            'par': [{'name': ''}, {'select': ''}],
+\            'val': {'select': ''},
+\            'co': {'select': ''},
+\            'each': {'select': ''},
+\            'ap': [{'select': ''}, {'mode': ''}]
+\        },
+\        'aliases': {
+\            'tmatch': 'xsl:template',
+\            'tname': 'xsl:template',
+\            'var': 'xsl:variable',
+\            'vari': 'xsl:variable',
+\            'if': 'xsl:if',
+\            'call': 'xsl:call-template',
+\            'wp': 'xsl:with-param',
+\            'par': 'xsl:param',
+\            'val': 'xsl:value-of',
+\            'attr': 'xsl:attribute',
+\            'co' : 'xsl:copy-of',
+\            'each' : 'xsl:for-each',
+\            'ap' : 'xsl:apply-templates'
+\        },
+\        'expandos': {
+\            'choose': 'xsl:choose>xsl:when+xsl:otherwise'
+\        }
+\    },
+\    'haml': {
+\        'extends': 'html'
+\    },
+\    'xhtml': {
+\        'extends': 'html'
+\    }
+\}
+
+function! s:zen_expandos(type, key)
+  let expandos = s:zen_getResource(a:type, 'expandos', {})
+  if has_key(expandos, a:key)
+    return expandos[a:key]
+  endif
+  return a:key
+endfunction
+
+function! s:zen_use_filter(filters, filter)
+  for f in a:filters
+    if f == a:filter
+      return 1
+    endif
+  endfor
+  if a:filter == 'html'
+    return 1
+  endif
+  return 0
+endfunction
+
+function! s:zen_is_extends(type, extend)
+  if a:type == a:extend
+    return 1
+  endif
+  if !has_key(s:zen_settings, a:type)
+    return 0
+  endif
+  if !has_key(s:zen_settings[a:type], 'extends')
+    return 0
+  endif
+  let extends = s:zen_settings[a:type].extends
+  if type(extends) == 1
+    let tmp = split(extends, '\s*,\s*')
+    unlet! extends
+    let extends = tmp
+  endif
+  for ext in extends
+    if a:extend == ext
+      return 1
+    endif
+  endfor
+  return 0
+endfunction
+
+function! s:zen_parseIntoTree(abbr, type)
+  let abbr = a:abbr
+  let type = a:type
+  if !has_key(s:zen_settings, type)
+    let type = 'html'
+  endif
+  if len(type) == 0 | let type = 'html' | endif
+
+  if has_key(s:zen_settings[type], 'indentation')
+    let indent = s:zen_settings[type].indentation
+  else
+    let indent = s:zen_settings.indentation
+  endif
+
+  let abbr = substitute(abbr, '\([a-zA-Z][a-zA-Z0-9]*\)+\([()]\|$\)', '\="(".s:zen_expandos(type, submatch(1)).")".submatch(2)', 'i')
+  let mx = '\([+>]\|<\+\)\{-}\s*\((*\)\{-}\s*\([@#]\{-}[a-zA-Z\!][a-zA-Z0-9:\!\-]*\|{[^}]\+}\)\(\%(\%(#[a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[a-zA-Z0-9_\-\$]\+\)\)*\)\%(\({[^}]\+}\)\)\{0,1}\%(\s*\*\s*\([0-9]\+\)\s*\)\{0,1}\(\%(\s*)\%(\s*\*\s*[0-9]\+\s*\)\{0,1}\)*\)'
+  let root = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0 }
+  let parent = root
+  let last = root
+  let pos = []
+  while len(abbr)
+    " parse line
+    let match = matchstr(abbr, mx)
+    let str = substitute(match, mx, '\0', 'ig')
+    let operator = substitute(match, mx, '\1', 'ig')
+    let block_start = substitute(match, mx, '\2', 'ig')
+    let tag_name = substitute(match, mx, '\3', 'ig')
+    let attributes = substitute(match, mx, '\4', 'ig')
+    let value = substitute(match, mx, '\5', 'ig')
+    let multiplier = 0 + substitute(match, mx, '\6', 'ig')
+    let block_end = substitute(match, mx, '\7', 'ig')
+    if len(str) == 0
+      break
+    endif
+    if tag_name =~ '^#'
+      let attributes = tag_name . attributes
+      let tag_name = 'div'
+    endif
+    if multiplier <= 0 | let multiplier = 1 | endif
+
+    " make default node
+    let current = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0 }
+    let current.name = tag_name
+
+    " aliases
+    let aliases = s:zen_getResource(type, 'aliases', {})
+    if has_key(aliases, tag_name)
+      let current.name = aliases[tag_name]
+    endif
+
+    " snippets
+    let snippets = s:zen_getResource(type, 'snippets', {})
+    if !empty(snippets) && has_key(snippets, tag_name)
+      let snippet = snippets[tag_name]
+      let snippet = substitute(snippet, '|', '${cursor}', 'g')
+      let lines = split(snippet, "\n")
+      call map(lines, 'substitute(v:val, "\\(    \\|\\t\\)", indent, "g")')
+      let current.snippet = join(lines, "\n")
+      let current.name = ''
+    endif
+
+    " default_attributes
+    let default_attributes = s:zen_getResource(type, 'default_attributes', {})
+    if !empty(default_attributes)
+      for pat in [current.name, tag_name]
+        if has_key(default_attributes, pat)
+          if type(default_attributes[pat]) == 4
+            let a = default_attributes[pat]
+            for k in keys(a)
+              let current.attr[k] = len(a[k]) ? substitute(a[k], '|', '${cursor}', 'g') : '${cursor}'
+            endfor
+          else
+            for a in default_attributes[pat]
+              for k in keys(a)
+                let current.attr[k] = len(a[k]) ? substitute(a[k], '|', '${cursor}', 'g') : '${cursor}'
+              endfor
+            endfor
+          endif
+          if has_key(s:zen_settings.html.default_attributes, current.name)
+            let current.name = substitute(current.name, ':.*$', '', '')
+          endif
+          break
+        endif
+      endfor
+    endif
+
+    " parse attributes
+    if len(attributes)
+      let attr = attributes
+      while len(attr)
+        let item = matchstr(attr, '\(\%(\%(#[a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[a-zA-Z0-9_\-\$]\+\)*\)\)')
+        if len(item) == 0
+          break
+        endif
+        if item[0] == '#'
+          let current.attr.id = item[1:]
+        endif
+        if item[0] == '.'
+          let current.attr.class = substitute(item[1:], '\.', ' ', 'g')
+        endif
+        if item[0] == '['
+          let kks = split(item[1:-2], ' ')
+          for kki in kks
+            let kk = split(kki, '=')
+            let current.attr[kk[0]] = len(kk) > 1 ? join(kk[1:], '=') : ''
+          endfor
+        endif
+        let attr = substitute(strpart(attr, len(item)), '^\s*', '', '')
+      endwhile
+    endif
+
+    " parse text
+    if tag_name =~ '^{.*}$'
+      let current.name = ''
+      let current.value = tag_name
+    else
+      let current.value = value
+    endif
+    let current.multiplier = multiplier
+
+    " parse step inside/outside
+    if !empty(last)
+      if operator =~ '>'
+        unlet! parent
+        let parent = last
+        let current.parent = last
+        let current.pos = last.pos + 1
+      else
+        let current.parent = parent
+        let current.pos = last.pos
+      endif
+    else
+      let current.parent = parent
+      let current.pos = 1
+    endif
+    if operator =~ '<'
+      for c in range(len(operator))
+        let tmp = parent.parent
+        if empty(tmp)
+          break
+        endif
+        let parent = tmp
+      endfor
+    endif
+
+    call add(parent.child, current)
+    let last = current
+
+    " parse block
+    if block_start =~ '('
+      if operator =~ '>'
+        let last.pos += 1
+      endif
+      for n in range(len(block_start))
+        let pos += [last.pos]
+      endfor
+    endif
+    if block_end =~ ')'
+      for n in split(substitute(substitute(block_end, ' ', '', 'g'), ')', ',),', 'g'), ',')
+        if n == ')'
+          if len(pos) > 0 && last.pos >= pos[-1]
+            for c in range(last.pos - pos[-1])
+              let tmp = parent.parent
+              if !has_key(tmp, 'parent')
+                break
+              endif
+              let parent = tmp
+            endfor
+            call remove(pos, -1)
+            let last = parent
+            let last.pos += 1
+          endif
+        elseif len(n)
+          let cl = last.child
+          let cls = []
+          for c in range(n[1:])
+            let cls += cl
+          endfor
+          let last.child = cls
+        endif
+      endfor
+    endif
+    let abbr = abbr[stridx(abbr, match) + len(match):]
+
+    if g:zencoding_debug > 1
+      echo "str=".str
+      echo "block_start=".block_start
+      echo "tag_name=".tag_name
+      echo "operator=".operator
+      echo "attributes=".attributes
+      echo "value=".value
+      echo "multiplier=".multiplier
+      echo "block_end=".block_end
+      echo "abbr=".abbr
+      echo "pos=".string(pos)
+      echo "\n"
+    endif
+  endwhile
+  return root
+endfunction
+
+function! s:zen_toString(...)
+  let current = a:1
+  if a:0 > 1
+    let type = a:2
+  else
+    let type = ''
+  endif
+  if !has_key(s:zen_settings, type)
+    let type = 'html'
+  endif
+  if len(type) == 0 | let type = 'html' | endif
+  if a:0 > 2
+    let inline = a:3
+  else
+    let inline = 0
+  endif
+  if a:0 > 3
+    if type(a:4) == 1
+      let filters = split(a:4, '\s*,\s*')
+    else
+      let filters = a:4
+    endif
+  else
+    let filters = ['html']
+  endif
+
+  if has_key(s:zen_settings[type], 'indentation')
+    let indent = s:zen_settings[type].indentation
+  else
+    let indent = s:zen_settings.indentation
+  endif
+  let m = 0
+  let str = ''
+  while m < current.multiplier
+    let comment_indent = ''
+    let comment = ''
+    if s:zen_use_filter(filters, 'haml')
+      if len(current.name) > 0
+        let str .= '%' . current.name
+        let tmp = ''
+        for attr in keys(current.attr)
+          let val = current.attr[attr]
+          if current.multiplier > 1
+            while val =~ '\$[^{]*'
+              let val = substitute(val, '\(\$\+\)\([^{]*\)', '\=printf("%0".len(submatch(1))."d", m+1).submatch(2)', 'g')
+            endwhile
+          endif
+          if attr == 'id'
+            let str .= '#' . val
+          elseif attr == 'class'
+            let str .= '.' . substitute(val, ' ', '.', 'g')
+          else
+            if len(tmp) > 0 | let tmp .= ',' | endif
+            let tmp .= ' :' . attr . ' => "' . val . '"'
+          endif
+        endfor
+        if len(tmp)
+          let str .= '{' . tmp . ' }'
+        endif
+        if stridx(','.s:zen_settings.html.empty_elements.',', ','.current.name.',') != -1 && len(current.value) == 0
+          let str .= "/"
+        elseif stridx(','.s:zen_settings.html.block_elements.',', ','.current.name.',') != -1 && (len(current.child) == 0 && len(current.value) == 0)
+          let str .= '<'
+        endif
+
+        let inner = ''
+        if len(current.value) > 0
+          let lines = split(current.value[1:-2], "\n")
+          let str .= " " . lines[0]
+          for line in lines[1:]
+            let str .= " |\n" . line
+          endfor
+        endif
+        if len(current.child) == 1 && len(current.child[0].name) == 0
+          let lines = split(current.child[0].value[1:-2], "\n")
+          let str .= " " . lines[0]
+          for line in lines[1:]
+            let str .= " |\n" . line
+          endfor
+        elseif len(current.child) > 0
+          for child in current.child
+            let inner .= s:zen_toString(child, type, inline, filters)
+          endfor
+          let inner = substitute(inner, "\n", "\n  ", 'g')
+          let inner = substitute(inner, "\n  $", "", 'g')
+          let str .= "\n  " . inner
+        endif
+      endif
+      let str .= "\n"
+    elseif len(current.name) && s:zen_use_filter(filters, 'html')
+      if s:zen_use_filter(filters, 'c')
+        let comment_indent = substitute(str, '^.*\(\s*\)$', '\1', '')
+      endif
+      let tmp = '<' . current.name
+      for attr in keys(current.attr)
+        if current.name =~ '^\(xsl:with-param\|xsl:variable\)$' && s:zen_use_filter(filters, 'xsl') && len(current.child) && attr == 'select'
+          continue
+        endif
+        let val = current.attr[attr]
+        if current.multiplier > 1
+          while val =~ '\$\([^{]\|$\)'
+            let val = substitute(val, '\(\$\+\)\([^{]\|$\)', '\=printf("%0".len(submatch(1))."d", m+1).submatch(2)', 'g')
+          endwhile
+        endif
+        let tmp .= ' ' . attr . '="' . val . '"'
+        if s:zen_use_filter(filters, 'c')
+          if attr == 'id' | let comment .= '#' . val | endif
+          if attr == 'class' | let comment .= '.' . val | endif
+        endif
+      endfor
+      if len(comment) > 0
+        let tmp = "<!-- " . comment . " -->" . (inline ? "" : "\n") . comment_indent . tmp
+      endif
+      let str .= tmp
+      let inner = current.value[1:-2]
+      if stridx(','.s:zen_settings.html.inline_elements.',', ','.current.name.',') != -1
+        let child_inline = 1
+      else
+        let child_inline = 0
+      endif
+      for child in current.child
+        let html = s:zen_toString(child, type, child_inline, filters)
+        if child.name == 'br'